fix(vue3): 修复混合布局顶级菜单点击失效

rootOnly 顶部菜单改为优先查找可见根路由,避免命中 remaining.ts 中同 path 的隐藏静态父路由。

修复混合垂直、混合双列布局下支付管理、会员中心、CRM、MES 等顶级菜单点击无反应的问题。
master
YunaiV 2026-06-12 21:23:58 +08:00
parent 74aaa6605e
commit 05d6196780
1 changed files with 3 additions and 1 deletions

View File

@ -376,7 +376,9 @@ export default defineComponent({
if (isUrl(index)) {
window.open(index)
} else {
const routeInfo = findRouteByPath(permissionStore.getRouters, index, '/', !props.rootOnly)
const routeInfo = props.rootOnly
? getRootMenuRoute(permissionStore.getRouters, index)
: findRouteByPath(permissionStore.getRouters, index)
const link = routeInfo?.route.meta?.link
if (typeof link === 'string') {
window.open(link)