Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
monorepo
/
venus
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
1
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 0b00c7bf
authored
Jul 05, 2024
by
invalid w
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
chore: 优化查找根菜单的逻辑
1 parent
ad6ae1d2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletions
packages/@core/forward/helpers/src/find-menu-by-path.ts
packages/@core/forward/helpers/src/find-menu-by-path.ts
View file @
0b00c7b
...
...
@@ -24,7 +24,9 @@ function findMenuByPath(
function
findRootMenuByPath
(
menus
:
MenuRecordRaw
[],
path
?:
string
)
{
const
findMenu
=
findMenuByPath
(
menus
,
path
);
const
rootMenuPath
=
findMenu
?.
parents
?.[
0
];
const
rootMenu
=
menus
.
find
((
item
)
=>
item
.
path
===
rootMenuPath
);
const
rootMenu
=
rootMenuPath
?
menus
.
find
((
item
)
=>
item
.
path
===
rootMenuPath
)
:
undefined
;
return
{
findMenu
,
rootMenu
,
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment