From bacc2031482e16d64243ef29aca181e6d3e2361e Mon Sep 17 00:00:00 2001 From: ddcat1115 Date: Fri, 16 Mar 2018 14:59:18 +0800 Subject: [PATCH] fix title can't be hidden in type icon when menu collapsed --- src/components/SiderMenu/SiderMenu.js | 2 +- src/components/SiderMenu/index.less | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/components/SiderMenu/SiderMenu.js b/src/components/SiderMenu/SiderMenu.js index 088a3690..9b7597e5 100644 --- a/src/components/SiderMenu/SiderMenu.js +++ b/src/components/SiderMenu/SiderMenu.js @@ -14,7 +14,7 @@ const { SubMenu } = Menu; // icon: , const getIcon = (icon) => { if (typeof icon === 'string' && icon.indexOf('http') === 0) { - return icon; + return icon; } if (typeof icon === 'string') { return ; diff --git a/src/components/SiderMenu/index.less b/src/components/SiderMenu/index.less index 3e790670..2f02116d 100644 --- a/src/components/SiderMenu/index.less +++ b/src/components/SiderMenu/index.less @@ -49,4 +49,18 @@ .drawer .drawer-content { background: #001529; } + .ant-menu-inline-collapsed { + & > .ant-menu-item .sider-menu-item-img + span, + & > .ant-menu-item-group > .ant-menu-item-group-list > .ant-menu-item .sider-menu-item-img + span, + & > .ant-menu-submenu > .ant-menu-submenu-title .sider-menu-item-img + span { + max-width: 0; + display: inline-block; + opacity: 0; + } + } + .ant-menu-item .sider-menu-item-img + span, + .ant-menu-submenu-title .sider-menu-item-img + span { + transition: opacity .3s @ease-in-out, width .3s @ease-in-out; + opacity: 1; + } } -- GitLab