Skip to content

Commit

Permalink
feat: Update code
Browse files Browse the repository at this point in the history
  • Loading branch information
nuintun committed May 21, 2024
1 parent 903063b commit f0540d3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/js/utils/menus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@ export function parse<M = unknown>(
);

// 遍历节点
for (const [node, parent] of tree) {
const { meta, children } = node;
for (const [current, parent] of tree) {
const { meta, children } = current;
const { key, name, icon, link } = meta;
const isLayout = children ? children.length > 0 : false;
const parentMenu = parent ? mapping.get(parent.meta.key) : parent;
Expand All @@ -118,7 +118,7 @@ export function parse<M = unknown>(
mapping.set(key, parentMenu);
}
} else {
const menu = transform(icon ? { key, name, link, icon } : { key, name, link }, node);
const menu = transform(icon ? { key, name, link, icon } : { key, name, link }, current);

if (isLayout) {
mapping.set(key, menu);
Expand Down

0 comments on commit f0540d3

Please sign in to comment.