Skip to content

Commit

Permalink
fix customize menu icon bug
Browse files Browse the repository at this point in the history
当采用自定义菜单图标(即通过url引用方式)且菜单折叠时,文字不隐藏
  • Loading branch information
lf7817 committed Feb 6, 2019
1 parent 171ec42 commit 0c38895
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/SiderMenu/BaseMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -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} />;
Expand Down

0 comments on commit 0c38895

Please sign in to comment.