This commit is contained in:
sjl
2025-01-15 09:36:12 +08:00
6 changed files with 211 additions and 211 deletions

View File

@@ -5,7 +5,7 @@
<router-view v-slot="{ Component, route }" style="height:100%;">
<!-- {{ keepAliveName}} -->
<!-- <transition name="slide-right" mode="out-in"> -->
<keep-alive :include="keepAliveName" >
<keep-alive :include="tabsMenuList" >
<component :is="Component" :key="route.fullPath" />
</keep-alive>
<!-- </transition> -->
@@ -26,11 +26,12 @@ import Maximize from "./components/Maximize.vue";
import Tabs from "@/layouts/components/Tabs/index.vue";
import Footer from "@/layouts/components/Footer/index.vue";
import { useAuthStore } from "@/stores/modules/auth";
import { useRoute, type RouteLocationNormalized } from 'vue-router'
import { useTabsStore } from '@/stores/modules/tabs'
const tabStore = useTabsStore()
const globalStore = useGlobalStore();
const tabsMenuList = computed(() => tabStore.tabsMenuList.map(item => item.name))
const authStore = useAuthStore();
const { maximize, isCollapse, layout, tabs, footer } = storeToRefs(globalStore);
const route = useRoute()
const keepAliveStore = useKeepAliveStore();
const { keepAliveName } = storeToRefs(keepAliveStore);
// console.log("🚀 ~ keepAliveName:", keepAliveName)
@@ -61,14 +62,7 @@ watch(
},
{ immediate: true }
);
watch(
() => route.path,
() => {
console.log(123, route.path);
},
);
// 监听窗口大小变化,折叠侧边栏
const screenWidth = ref(0);