diff --git a/src/layouts/index.tsx b/src/layouts/index.tsx index 7d87490..070a9a1 100644 --- a/src/layouts/index.tsx +++ b/src/layouts/index.tsx @@ -169,7 +169,8 @@ export default defineComponent({ const { showBreadcrumb, showFooter, isUseTabsRouter } = settingStore; const { tabRouters } = tabsRouterStore; return ( - + // 如果存在多个滚动列表之间切换时,页面不刷新导致的样式问题 请设置key 但会导致多标签tab页的缓存失效 + {isUseTabsRouter && ( state, getters: { @@ -20,9 +24,10 @@ export const useTabsRouterStore = defineStore('tabsRouter', { this.tabRouters[routeIdx].isAlive = !this.tabRouters[routeIdx].isAlive; }, appendTabRouterList(newRoute: TRouterInfo) { + const needAlive = !ignoreCacheRoutes.includes(newRoute.name); if (!this.tabRouters.find((route: TRouterInfo) => route.path === newRoute.path)) { // eslint-disable-next-line no-param-reassign - this.tabRouterList = this.tabRouterList.concat(newRoute); + this.tabRouterList = this.tabRouterList.concat({ ...newRoute, isAlive: needAlive }); } }, subtractCurrentTabRouter(newRoute: TRouterInfo) {