update src/layout/routerView/parent.vue.

这里应该拿到的是已经设置开启组件缓存的路由,而不是全部,需要先判断item.meta.isKeepAlive

Signed-off-by: mrjimin <z8888788@163.com>
This commit is contained in:
mrjimin 2022-12-03 07:31:01 +00:00 committed by Gitee
parent 7b26cb21dd
commit 02e7c49750
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -82,7 +82,10 @@ onMounted(() => {
// https://gitee.com/lyt-top/vue-next-admin/issues/I59RXK
nextTick(() => {
setTimeout(() => {
if (themeConfig.value.isCacheTagsView) cachedViews.value = Session.get('tagsViewList')?.map((item: RouteItem) => item.name);
if (themeConfig.value.isCacheTagsView) {
let tagsViewArr:RouteItem[] = Session.get('tagsViewList') || []
cachedViews.value = tagsViewArr.filter((item) => item.meta.isKeepAlive).map((item) => item.name)
}
}, 0);
});
});