Skip to content
This repository has been archived by the owner on Aug 11, 2020. It is now read-only.

Commit

Permalink
πŸ› bug: fix hideChildrenInMenu no work for menuItemRender (#556)
Browse files Browse the repository at this point in the history
  • Loading branch information
chenshuai2144 authored Jul 13, 2020
1 parent 220c77b commit 289a47b
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions src/SiderMenu/BaseMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -205,17 +205,19 @@ class MenuUtil {
}

if (menuItemRender) {
return menuItemRender(
{
...item,
isUrl: isHttpUrl,
itemPath,
isMobile,
replace: itemPath === location.pathname,
onClick: () => onCollapse && onCollapse(true),
},
defaultItem,
);
const renderItemProps = {
...item,
isUrl: isHttpUrl,
itemPath,
isMobile,
replace: itemPath === location.pathname,
onClick: () => onCollapse && onCollapse(true),
};
// ε¦‚ζžœ hideChildrenInMenu εˆ ι™€ζŽ‰ζ— η”¨ηš„ children
if (renderItemProps.hideChildrenInMenu) {
delete renderItemProps.children;
}
return menuItemRender(renderItemProps, defaultItem);
}
return defaultItem;
};
Expand Down

0 comments on commit 289a47b

Please sign in to comment.