From 62b8327d0715cbcdafc97a40085eee3daaa9d275 Mon Sep 17 00:00:00 2001 From: xlsea Date: Thu, 22 May 2025 19:13:00 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E9=9A=90=E8=97=8F=E8=8F=9C?= =?UTF-8?q?=E5=8D=95=E6=BF=80=E6=B4=BB=E9=83=A8=E5=88=86=E9=87=8D=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/store/modules/route/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/store/modules/route/index.ts b/src/store/modules/route/index.ts index b65ccd21..6edff7ea 100644 --- a/src/store/modules/route/index.ts +++ b/src/store/modules/route/index.ts @@ -130,9 +130,9 @@ export const useRouteStore = defineStore(SetupStoreId.Route, () => { // @ts-expect-error no hidden field route.meta.hideInMenu = route.hidden; - if (route.meta.hideInMenu) { + if (route.meta.hideInMenu && parent) { // @ts-expect-error parent.name is activeMenu type - route.meta.activeMenu = parent ? parent.name : null; + route.meta.activeMenu = parent.name; } // 是否需要keepAlive route.meta.keepAlive = !route.meta.noCache;