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

XProvider 的 iconPrefixCls 设置失效 #588

Open
liaokaime opened this issue Mar 10, 2025 · 1 comment
Open

XProvider 的 iconPrefixCls 设置失效 #588

liaokaime opened this issue Mar 10, 2025 · 1 comment
Labels
bug Something isn't working

Comments

@liaokaime
Copy link

liaokaime commented Mar 10, 2025

重现步骤

步骤:

  1. 设置 XProvider 的 iconPrefixCls 为 "ant5x-icon"
<XProvider
    theme={ant5xTheme}
    prefixCls={prefixCls}
    iconPrefixCls={"ant5x-icon"}
    locale={zhCNAnt}
/>

当前行为

实际页面中的class名称仍然为 "anticon"
Image

预期行为

class名字变为 "ant5x-icon"

上下文

我的项目同时存在 antd 2.x 和 antd 5.x(因为项目太大,2.x升不上去)。所以我使用了 5.x 的 Provider 设置了 prefixCls 、iconPrefixCls 属性,它们一起工作地非常好,没有css冲突。但当我使用 Antd X 时,发现 icon 的没有按照预期工作,它显示了2次,原因是 Antd X 中的 icon 的 class 名没有按照 Provider 中的名字设置。

版本

1.0.5

您在哪些浏览器上遇到了这个问题?

Chrome

@liaokaime liaokaime added the bug Something isn't working label Mar 10, 2025
Copy link

目前没有找到其他类似的问题报告。根据您的描述,可能需要检查以下几点:

  1. 确保正确使用 Provider: 确保 XProvidericonPrefixCls 属性在应用中被正确传递和使用。

  2. 检查 CSS 覆盖: 确保没有其他的 CSS 覆盖了 iconPrefixCls 的设置。

  3. 版本兼容性: 确保您使用的 Antd X 版本与其他依赖库版本之间没有兼容性问题。

如果这些检查都没有解决问题,可能需要查看 Antd X 的源码,确认 iconPrefixCls 的实现是否存在问题。

如果您需要进一步的帮助,或者希望我为您创建一个问题报告,请告诉我。

🪧 Tips For further assistance, please describe your question in the comments and @petercat-assistant to start a conversation with me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant