Commit 7e18eb74 by vince
2 parents 8042e2b0 0b00c7bf
...@@ -24,7 +24,9 @@ function findMenuByPath( ...@@ -24,7 +24,9 @@ function findMenuByPath(
function findRootMenuByPath(menus: MenuRecordRaw[], path?: string) { function findRootMenuByPath(menus: MenuRecordRaw[], path?: string) {
const findMenu = findMenuByPath(menus, path); const findMenu = findMenuByPath(menus, path);
const rootMenuPath = findMenu?.parents?.[0]; const rootMenuPath = findMenu?.parents?.[0];
const rootMenu = menus.find((item) => item.path === rootMenuPath); const rootMenu = rootMenuPath
? menus.find((item) => item.path === rootMenuPath)
: undefined;
return { return {
findMenu, findMenu,
rootMenu, rootMenu,
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!