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

antd4的icon设计是我见过的最不合理的icon组织形式 #26639

Closed
MorganDream opened this issue Sep 8, 2020 · 3 comments
Closed

antd4的icon设计是我见过的最不合理的icon组织形式 #26639

MorganDream opened this issue Sep 8, 2020 · 3 comments
Labels

Comments

@MorganDream
Copy link

基于antd4对于ts和hooks的良好支持,我们决定升级antd。
为了符合项目兼容新旧代码的模式。我们用了antd3与antd4并存的模式。
"antd": "3.0.0", "antd4": "npm:antd@4.6.2",
我们有个地方用到了icon,icon的type是动态获取的。这在antd4的icon设计模式下基本无解。于是采用了@ant-designs/compatible的兼容包,而兼容包的默认去引用antd也就是版本3了。

我见过一些UI库,基本icon的引入都是通过某个prop甚至class就能解决。像antd4的这种硬引入模式对动态化、可配置化开发极为不友好。
虽然你们可能不会给出解决方法,但还是要吐槽一下。

@ant-design-bot
Copy link
Contributor

Hello @MorganDream, your issue has been closed because it does not conform to our issue requirements. Please use the Issue Helper to create an issue, thank you!

你好 @MorganDream,为了能够进行高效沟通,我们对 issue 有一定的格式要求,你的 issue 因为不符合要求而被自动关闭。你可以通过 issue 助手 来创建 issue 以方便我们定位错误。谢谢配合!

@yoyo837
Copy link
Contributor

yoyo837 commented Sep 8, 2020

请看一下之前的解决方案,#12011 可以在issue里搜索一下为什么要这么改。

@MorganDream
Copy link
Author

感谢回复。
我们改成了"antd": "4.6.2", "antd3": "npm:antd@3.0.0", 同时使用兼容包解决了问题。

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

No branches or pull requests

3 participants