From 3ad83cbcd6e9221976c7da16cc60d184916f1d18 Mon Sep 17 00:00:00 2001 From: Gor-c Date: Mon, 28 Apr 2025 14:14:37 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E7=BB=84=E5=90=88?= =?UTF-8?q?=E6=A8=A1=E5=BC=8F=E4=B8=8B=EF=BC=8C=E9=A1=B6=E9=83=A8=E8=8F=9C?= =?UTF-8?q?=E5=8D=95=E9=87=8D=E5=A4=8Dbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/src/pinia/modules/router.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/web/src/pinia/modules/router.js b/web/src/pinia/modules/router.js index db8c5150..4ee54891 100644 --- a/web/src/pinia/modules/router.js +++ b/web/src/pinia/modules/router.js @@ -101,6 +101,8 @@ export const useRouterStore = defineStore('router', () => { watchEffect(() => { let topActive = sessionStorage.getItem('topActive') asyncRouters.value[0]?.children.forEach((item) => { + // 初始化菜单内容,防止重复添加 + topMenu.value = []; if (item.hidden) return menuMap[item.name] = item topMenu.value.push({ ...item, children: [] })