Commit 5ef08f7f authored by lf7817's avatar lf7817 Committed by 陈帅

fix customize menu icon bug (#3509)

* fix customize menu icon bug

当采用自定义菜单图标(即通过url引用方式)且菜单折叠时,文字不隐藏

* fix customize menu icon bug

修改样式
parent 7c1e9d41
......@@ -15,7 +15,7 @@ const { SubMenu } = Menu;
// icon: <Icon type="setting" />,
const getIcon = icon => {
if (typeof icon === 'string' && isUrl(icon)) {
return <img src={icon} alt="icon" className={styles.icon} />;
return <Icon component={() => <img src={icon} alt="icon" className={styles.icon} />} />;
}
if (typeof icon === 'string') {
return <Icon type={icon} />;
......
......@@ -66,8 +66,8 @@
}
.icon {
vertical-align: baseline;
width: 14px;
margin-right: 10px;
}
:global {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment