From 503dcfd538ebb245254a25ca3c440d4e3891baf6 Mon Sep 17 00:00:00 2001 From: eruca Date: Mon, 16 Jul 2018 00:22:51 +0100 Subject: [PATCH] =?UTF-8?q?=E5=87=8F=E5=B0=91=E4=B8=80=E6=AC=A1=E5=88=A4?= =?UTF-8?q?=E6=96=AD=EF=BC=8C=E5=8F=8A=E4=BF=AE=E6=AD=A3=E4=B8=80=E4=B8=AA?= =?UTF-8?q?=E6=96=87=E6=A1=A3=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/SiderMenu/SiderMenu.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/components/SiderMenu/SiderMenu.js b/src/components/SiderMenu/SiderMenu.js index 5d26bfd8..8c2f77d1 100644 --- a/src/components/SiderMenu/SiderMenu.js +++ b/src/components/SiderMenu/SiderMenu.js @@ -13,18 +13,19 @@ const { SubMenu } = Menu; // icon: 'http://demo.com/icon.png', // icon: , const getIcon = icon => { - if (typeof icon === 'string' && icon.indexOf('http') === 0) { - return icon; - } if (typeof icon === 'string') { + if (icon.indexOf('http') === 0) { + return icon; + } return ; } + return icon; }; /** * Recursively flatten the data - * [{path:string},{path:string}] => {path,path2} + * [{path:string},{path:string}] => [path,path2] * @param menu */ export const getFlatMenuKeys = menu => -- GitLab