1
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<section class="app-main">
|
||||
<transition name="fade-transform" mode="out-in">
|
||||
<keep-alive :include="cachedViews">
|
||||
<keep-alive :include="keepAliveInclude">
|
||||
<router-view v-if="!$route.meta.link" :key="key" />
|
||||
</keep-alive>
|
||||
</transition>
|
||||
@@ -21,6 +21,11 @@ export default {
|
||||
cachedViews() {
|
||||
return this.$store.state.tagsView.cachedViews
|
||||
},
|
||||
// cachedViews 为空时勿传 []:Vue2 keep-alive 的 include 为 [] 会匹配不到任何组件,部分环境下首屏空白
|
||||
keepAliveInclude() {
|
||||
const list = this.cachedViews
|
||||
return list && list.length ? list : undefined
|
||||
},
|
||||
key() {
|
||||
return this.$route.path
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user