update: auth state change should reset keepalive
This commit is contained in:
+5
-1
@@ -3,6 +3,10 @@ import { RouterView } from 'vue-router';
|
||||
|
||||
import Navbar from './components/Navbar.vue';
|
||||
import Footer from './components/Footer.vue';
|
||||
|
||||
import { useAuthStore } from './stores/auth';
|
||||
|
||||
const authStore = useAuthStore();
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -10,7 +14,7 @@ import Footer from './components/Footer.vue';
|
||||
<div style="flex: 1;">
|
||||
<RouterView v-slot="{ Component }">
|
||||
<KeepAlive>
|
||||
<component :key="$route.name" :is="Component" v-if="$route.meta.keepAlive" />
|
||||
<component :key="`${authStore.jwt}-${$route.name}`" :is="Component" v-if="$route.meta.keepAlive" />
|
||||
</KeepAlive>
|
||||
<component :is="Component" v-if="!$route.meta.keepAlive" />
|
||||
</RouterView>
|
||||
|
||||
Reference in New Issue
Block a user