howie 3 éve
szülő
commit
32ecb34ec8
2 módosított fájl, 4 hozzáadás és 3 törlés
  1. 3 3
      src/layout/components/AppMain.vue
  2. 1 0
      src/mixin/index.js

+ 3 - 3
src/layout/components/AppMain.vue

@@ -1,9 +1,9 @@
 <template>
   <section class="app-main">
     <transition name="fade-transform" mode="out-in">
-      <!-- <keep-alive :include="cachedViews"> -->
+      <keep-alive :include="cachedViews">
         <router-view :key="key" />
-      <!-- </keep-alive> -->
+      </keep-alive>
     </transition>
   </section>
 </template>
@@ -13,10 +13,10 @@ export default {
   name: 'AppMain',
   computed: {
     cachedViews() {
+      // console.log(this.$store.state.tagsView.cachedViews);
       return this.$store.state.tagsView.cachedViews
     },
     key() {
-      console.log(this.$route.path);
       return this.$route.path
     }
   }

+ 1 - 0
src/mixin/index.js

@@ -24,6 +24,7 @@ export default {
     }
   },
   created() {
+    console.log('缓存了');
     this.getList();
   },
   methods: {