Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

修复菜单标签不显示不缓存的菜单 #42

Merged
merged 2 commits into from
Nov 23, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions ruoyi-ui/src/store/modules/tabs-router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,8 @@ export const useTabsRouterStore = defineStore('tabsRouter', {
},
// 处理新增
appendTabRouterList(newRoute: TRouterInfo) {
// 不要将判断条件newRoute.meta.keepAlive !== false修改为newRoute.meta.keepAlive,starter默认开启保活,所以meta.keepAlive未定义时也需要进行保活,只有显式说明false才禁用保活。
const needAlive =
!ignoreCacheRoutes.includes(newRoute.name as string) &&
(newRoute.meta?.keepAlive ?? !newRoute.meta?.noCache) !== false;
const needAlive = !ignoreCacheRoutes.includes(newRoute.name as string);
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 });
}
},
Expand Down