|
|
@@ -11,10 +11,9 @@
|
|
|
<NavBar v-if="!isInMiniProgram" />
|
|
|
<main>
|
|
|
<RouterView v-slot="{ Component }">
|
|
|
- <KeepAlive>
|
|
|
- <component :is="Component" v-if="route.meta.keepAlive" />
|
|
|
+ <KeepAlive :include="keepAliveStore.cachedViews">
|
|
|
+ <component :is="Component" :key="route.name" />
|
|
|
</KeepAlive>
|
|
|
- <component :is="Component" v-if="!route.meta.keepAlive" />
|
|
|
</RouterView>
|
|
|
</main>
|
|
|
<FooterSmall v-if="!isInMiniProgram" />
|
|
|
@@ -25,6 +24,7 @@
|
|
|
import { onMounted, watch } from 'vue';
|
|
|
import { RouterView, useRoute } from 'vue-router'
|
|
|
import { useAuthStore } from './stores/auth';
|
|
|
+import { useKeepAliveStore } from './stores/keepAlive';
|
|
|
import { useRedirectLoginPage } from './common/LoginPageRedirect';
|
|
|
import { useAppConfiguration } from './api/system/useAppConfiguration';
|
|
|
import NavBar from './components/NavBar.vue';
|
|
|
@@ -33,6 +33,7 @@ import FooterSmall from './components/FooterSmall.vue';
|
|
|
import { isInMiniProgram } from './composeables/MiniProgramIng.ts';
|
|
|
|
|
|
const authStore = useAuthStore();
|
|
|
+const keepAliveStore = useKeepAliveStore();
|
|
|
const { checkAndRedirectLoginPage } = useRedirectLoginPage();
|
|
|
const { loadAppConfiguration } = useAppConfiguration();
|
|
|
|