Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

自定义菜单图标时收起菜单导致文字不隐藏 #2782

Closed
puuuudding opened this issue Nov 6, 2018 · 3 comments
Closed

自定义菜单图标时收起菜单导致文字不隐藏 #2782

puuuudding opened this issue Nov 6, 2018 · 3 comments

Comments

@puuuudding
Copy link
Contributor

puuuudding commented Nov 6, 2018

现象以下截图所示
image
这是用自定义icon时的DOM结构
image
这是用antd自带的icon时的DOM结构
image
这是隐藏菜单文字的css
image

可以看到隐藏是通过.anticon+span找到的,但是用自定义icon的时候元素是<img>所以会找不到

@afc163
Copy link
Member

afc163 commented Nov 6, 2018

Duplicate of #2783

@puuuudding
Copy link
Contributor Author

我又看了一下#2783,我觉得不是duplicate,默认在收起后会隐藏一级菜单的文字,因为icon上有.anticonclass,而如果用自定义图片的话就没有这个class,导致一级菜单的文字不会隐藏

@sjx1995
Copy link

sjx1995 commented Jan 13, 2020

@puuuudding 说的没错,可以在自定义图标外面加上一个.anticon的span来解决

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants