From 99099eb20d9be406cfb5e7f95717344fa6895a32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E4=BC=9F=E8=8D=A3?= Date: Mon, 16 Jul 2018 18:01:39 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BE=A7=E8=BE=B9=E6=A0=8F?= =?UTF-8?q?=E8=8F=9C=E5=8D=95=E4=B8=8D=E8=83=BD=E5=8A=A8=E6=80=81=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/SiderMenu/SiderMenu.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/components/SiderMenu/SiderMenu.js b/src/components/SiderMenu/SiderMenu.js index fb8f1a76..5d26bfd8 100644 --- a/src/components/SiderMenu/SiderMenu.js +++ b/src/components/SiderMenu/SiderMenu.js @@ -196,7 +196,8 @@ export default class SiderMenu extends PureComponent { }; isMainMenu = key => { - return this.props.menuData.some(item => key && (item.key === key || item.path === key)); + const { menuData } = this.props; + return menuData.some(item => key && (item.key === key || item.path === key)); }; handleOpenChange = openKeys => { @@ -208,7 +209,7 @@ export default class SiderMenu extends PureComponent { }; render() { - const { logo, collapsed, onCollapse } = this.props; + const { logo, menuData, collapsed, onCollapse } = this.props; const { openKeys } = this.state; // Don't show popup menu when it is been collapsed const menuProps = collapsed @@ -246,7 +247,7 @@ export default class SiderMenu extends PureComponent { selectedKeys={selectedKeys} style={{ padding: '16px 0', width: '100%' }} > - {this.getNavMenuItems(this.props.menuData)} + {this.getNavMenuItems(menuData)} ); -- GitLab