소스 검색

update 回滚解决路由失效问题

LiuHao 1 년 전
부모
커밋
1d7c3da86b
1개의 변경된 파일9개의 추가작업 그리고 2개의 파일을 삭제
  1. 9 2
      src/layout/components/AppMain.vue

+ 9 - 2
src/layout/components/AppMain.vue

@@ -1,6 +1,6 @@
 <template>
   <section class="app-main">
-    <router-view v-slot="{ Component, route }" :key="$route.fullPath">
+    <router-view v-slot="{ Component, route }">
       <transition :enter-active-class="animante" mode="out-in">
         <keep-alive :include="tagsViewStore.cachedViews">
           <component :is="Component" v-if="!route.meta.link" :key="route.path" />
@@ -23,8 +23,15 @@ const tagsViewStore = useTagsViewStore();
 const animante = ref<string>('');
 const animationEnable = ref(useSettingsStore().animationEnable);
 watch(
-  () => useSettingsStore().animationEnable,
+  () => tagsViewStore.cachedViews,
   (val) => {
+    console.log(val);
+  },
+  { deep: true }
+);
+watch(
+  () => useSettingsStore().animationEnable,
+  (val: boolean) => {
     animationEnable.value = val;
     if (val) {
       animante.value = proxy?.animate.animateList[Math.round(Math.random() * proxy?.animate.animateList.length)] as string;