Browse Source

Fix menu order

pull/8729/head
Wei Zhu 7 years ago
parent
commit
9cb8472c4a
  1. 4
      site/theme/template/Content/MainContent.jsx

4
site/theme/template/Content/MainContent.jsx

@ -180,7 +180,9 @@ export default class MainContent extends React.Component {
if (child.type === 'type') {
return (
<Menu.ItemGroup title={child.title} key={child.title}>
{child.children.map(leaf => this.generateMenuItem(false, leaf))}
{child.children.sort((a, b) => {
return a.title.charCodeAt(0) - b.title.charCodeAt(0);
}).map(leaf => this.generateMenuItem(false, leaf))}
</Menu.ItemGroup>
);
}

Loading…
Cancel
Save