mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-29 13:47:02 +08:00
Fix es6 function
This commit is contained in:
parent
3aab04d4a5
commit
8c5c458304
@ -119,8 +119,11 @@ export default class MainContent extends React.Component {
|
||||
|
||||
getFooterNav(menuItems, activeMenuItem) {
|
||||
const menuItemsList = this.flattenMenu(menuItems);
|
||||
const activeMenuItemIndex = menuItemsList.findIndex((menuItem) => {
|
||||
return menuItem.key === activeMenuItem;
|
||||
let activeMenuItemIndex = -1;
|
||||
menuItemsList.forEach((menuItem, i) => {
|
||||
if (menuItem.key === activeMenuItem) {
|
||||
activeMenuItemIndex = i;
|
||||
}
|
||||
});
|
||||
const prev = menuItemsList[activeMenuItemIndex - 1];
|
||||
const next = menuItemsList[activeMenuItemIndex + 1];
|
||||
|
@ -51,9 +51,9 @@ export function generateContainer(data) {
|
||||
|
||||
export function generateIndex(data) {
|
||||
const menuItems = getMenuItems(data);
|
||||
const firstChild = menuItems.topLevel.topLevel.find((item) => {
|
||||
const firstChild = menuItems.topLevel.topLevel.filter((item) => {
|
||||
return item.disabled !== 'true';
|
||||
});
|
||||
})[0];
|
||||
return (
|
||||
<IndexRedirect key="index"
|
||||
to={fileNameToPath(firstChild.fileName)} />
|
||||
|
Loading…
Reference in New Issue
Block a user