mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-24 19:19:57 +08:00
site: fix menu item
This commit is contained in:
parent
0793534665
commit
e93dd1e5af
@ -153,7 +153,7 @@ export default class MainContent extends React.Component {
|
||||
const result = [...topLevel];
|
||||
result.forEach((item, i) => {
|
||||
const insertCategory = categories.filter(
|
||||
cat => (themeConfig.categoryOrder[cat] ? themeConfig.categoryOrder[cat] < i : i === result.length - 1)
|
||||
cat => (themeConfig.categoryOrder[cat] ? themeConfig.categoryOrder[cat] <= i : i === result.length - 1)
|
||||
)[0];
|
||||
if (insertCategory) {
|
||||
const target = (
|
||||
@ -161,7 +161,7 @@ export default class MainContent extends React.Component {
|
||||
{this.generateSubMenuItems(menuItems[insertCategory])}
|
||||
</SubMenu>
|
||||
);
|
||||
result.splice(i, 0, target);
|
||||
result.splice(i + 1, 0, target);
|
||||
categories.splice(categories.indexOf(insertCategory), 1);
|
||||
}
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user