From 6fdb95fe31b264f83d45158d891c6d03ee7d5ccb Mon Sep 17 00:00:00 2001 From: zhf <1204297681@qq.com> Date: Fri, 6 Jun 2025 18:37:31 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E7=A9=BA=E5=80=BC?= =?UTF-8?q?=E6=8A=A5=E9=94=99=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/control/app-menu/app-menu.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/control/app-menu/app-menu.tsx b/src/control/app-menu/app-menu.tsx index c9ebe6fbe..b182f83da 100644 --- a/src/control/app-menu/app-menu.tsx +++ b/src/control/app-menu/app-menu.tsx @@ -399,7 +399,7 @@ export const AppMenuControl = defineComponent({ return false; } const func = app.getAppFunc(item.appFuncId!); - if (func && func.appViewId && route.params.view2) { + if (func && func.appViewId && route?.params.view2) { return func.appViewId.split('.')[1] === route.params.view2; } } @@ -424,7 +424,7 @@ export const AppMenuControl = defineComponent({ // 监听二级路由参数,变化时计算当前激活菜单回显 if (c.runMode !== 'DESIGN') { watch( - () => route.params.view2, + () => route?.params.view2, (newVal, oldVal) => { if (newVal !== oldVal && ibiz.config.appMenu.enableEcho) { const activeMenu = calcCurMenu(); @@ -447,8 +447,8 @@ export const AppMenuControl = defineComponent({ }); if ( defaultActiveMenuItem && - !route.params.view2 && - !route.fullPath.includes('404') + !route?.params.view2 && + !route?.fullPath.includes('404') ) { defaultActive.value = defaultActiveMenuItem.id!; onClick(defaultActive.value); -- Gitee