Commit 5b88067d by Sendya

fix: multi-tab mode always component keep-alive & cleanup eslint

Signed-off-by: 's avatarSendya <18x@loacg.com>
parent 9d00ebbd
......@@ -38,7 +38,7 @@ export default {
}
this.pages = this.pages.filter(page => page.fullPath !== targetKey)
this.fullPathList = this.fullPathList.filter(path => path !== targetKey)
},
}
},
watch: {
'$route': function (newVal) {
......
......@@ -5,7 +5,7 @@ export default {
return {}
},
render () {
const { $route: { meta } } = this
const { $route: { meta }, $store: { getters } } = this
const inKeep = (
<keep-alive>
......@@ -15,7 +15,10 @@ export default {
const notKeep = (
<router-view />
)
return meta.keepAlive ? inKeep : notKeep
// 这里增加了 multiTab 的判断,当开启了 multiTab 时
// 应当全部组件皆缓存,否则会导致切换页面后页面还原成原始状态
// 若确实不需要,可改为 return meta.keepAlive ? inKeep : notKeep
return meta.keepAlive || getters.multiTab ? inKeep : notKeep
}
}
</script>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment