mirror of
https://github.com/m-xlsea/ruoyi-plus-soybean.git
synced 2025-09-24 07:49:47 +08:00
fix(projects): 修复路由命名为包含关系时导致导航数据出错的问题
This commit is contained in:
@ -1,3 +1,4 @@
|
||||
import { getTopLevelMenu } from './helpers';
|
||||
/**
|
||||
* 获取面包屑数据
|
||||
* @param activeKey - 当前页面路由的key
|
||||
@ -17,13 +18,9 @@ export function getBreadcrumbByRouteKey(activeKey: string, menus: App.GlobalMenu
|
||||
*/
|
||||
function getBreadcrumbMenu(activeKey: string, menus: App.GlobalMenuOption[]) {
|
||||
const breadcrumbMenu: App.GlobalMenuOption[] = [];
|
||||
menus.some(menu => {
|
||||
const flag = activeKey.includes(menu.routeName);
|
||||
if (flag) {
|
||||
breadcrumbMenu.push(...getBreadcrumbMenuItem(activeKey, menu));
|
||||
}
|
||||
return flag;
|
||||
});
|
||||
const topLevelMenu = getTopLevelMenu(activeKey, menus);
|
||||
const options = getBreadcrumbMenuItem(activeKey, topLevelMenu as App.GlobalMenuOption);
|
||||
breadcrumbMenu.push(...options);
|
||||
return breadcrumbMenu;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user