diff --git a/src/store/modules/menu.ts b/src/store/modules/menu.ts index 2627622..327474f 100644 --- a/src/store/modules/menu.ts +++ b/src/store/modules/menu.ts @@ -188,8 +188,7 @@ } else { // 如果是 string 类型,则认为是路由,需要查找对应的主导航索引 - // const findIndex = this.allMenus.findIndex(item => item.children.some(r => data.indexOf(`${r.path}/`) === 0 || data === r.path)) - const findIndex = this.allMenus.findIndex(item => item.children.some(r => data === r.path)) + const findIndex = this.allMenus.findIndex(item => item.children.some(r => data.indexOf(`${r.path}`) === 0 || data === r.path)) if (findIndex >= 0) { this.actived = findIndex }