refactor: 路由名称与组件名称保持一致,解决keepAlive问题

This commit is contained in:
dap
2025-05-13 21:15:58 +08:00
parent 2d7077bf6d
commit 3c90c3ccfe
3 changed files with 57 additions and 4 deletions

View File

@ -113,8 +113,8 @@ export const useRouteStore = defineStore(SetupStoreId.Route, () => {
// @ts-expect-error no hidden field
route.meta.hideInMenu = Boolean(route.hidden) || false;
route.meta.keepAlive = Boolean(route.meta.noCache) || false;
// 是否需要keepAlive
route.meta.keepAlive = !route.meta.noCache || false;
if (route.component !== 'layout.base') {
route.component = parent ? `view.${route.component}` : `layout.base$view.${route.component}`;