fix(components): 修复路由在path中包含重复路单词径菜单时,被激活会错误展开

This commit is contained in:
shabby2333 2023-01-13 13:03:38 +00:00
parent 0882c25034
commit 264da00e5d

View File

@ -45,7 +45,7 @@ export function getActiveKeyPathsOfMenus(activeKey: string, menus: App.GlobalMen
function getActiveKeyPathsOfMenu(activeKey: string, menu: App.GlobalMenuOption) {
const keys: string[] = [];
if (activeKey.includes(menu.routeName)) {
if (activeKey.startsWith(menu.routeName)) {
keys.push(menu.routeName);
}
if (menu.children) {