mirror of
https://github.com/Tencent/tdesign-vue-next-starter.git
synced 2024-11-10 06:58:23 +08:00
fix: 修复多标签页保活问题 (#523)
This commit is contained in:
parent
f9f9e91438
commit
89ccf19f58
|
@ -36,7 +36,8 @@ export const useTabsRouterStore = defineStore('tabsRouter', {
|
|||
},
|
||||
// 处理新增
|
||||
appendTabRouterList(newRoute: TRouterInfo) {
|
||||
const needAlive = !ignoreCacheRoutes.includes(newRoute.name as string);
|
||||
// 不要将判断条件newRoute.meta.keepAlive !== false修改为newRoute.meta.keepAlive,starter默认开启保活,所以meta.keepAlive未定义时也需要进行保活,只有显式说明false才禁用保活。
|
||||
const needAlive = !ignoreCacheRoutes.includes(newRoute.name as string) && newRoute.meta?.keepAlive !== false;
|
||||
if (!this.tabRouters.find((route: TRouterInfo) => route.path === newRoute.path)) {
|
||||
// eslint-disable-next-line no-param-reassign
|
||||
this.tabRouterList = this.tabRouterList.concat({ ...newRoute, isAlive: needAlive });
|
||||
|
|
Loading…
Reference in New Issue
Block a user