浏览代码

fix(架构): 修复SmartPageProvider导致keep-alive失效的问题

shizhongming 2 年之前
父节点
当前提交
db1fb45d47
共有 1 个文件被更改,包括 5 次插入5 次删除
  1. 5 5
      src/layouts/page/index.vue

+ 5 - 5
src/layouts/page/index.vue

@@ -14,12 +14,12 @@
         mode="out-in"
         appear
       >
-        <keep-alive v-if="openCache" :include="getCaches">
-          <SmartPageProvider>
+        <SmartPageProvider>
+          <keep-alive v-if="openCache" :include="getCaches">
             <component :is="Component" :key="route.fullPath" />
-          </SmartPageProvider>
-        </keep-alive>
-        <component v-else :is="Component" :key="route.fullPath" />
+          </keep-alive>
+          <component v-else :is="Component" :key="route.fullPath" />
+        </SmartPageProvider>
       </transition>
     </template>
   </RouterView>