pro-components icon indicating copy to clipboard operation
pro-components copied to clipboard

🐛[BUG] ConfigProvider 设置 hashed: false 无效,因为被 ProLayout 里的给覆盖了

Open linxianxi opened this issue 1 year ago • 2 comments

🐛 bug 描述

如题

📷 复现步骤

根据复现代码查看控制台

🏞 期望结果

样式没有 hash

💻 复现代码

ProLayout 里有 ConfigProvider,并设置了 hashed,所以导致外面设置无效

<ConfigProvider theme={{ cssVar: true, hashed: false }}>
   <ProLayout />
</ConfigProvider>

© 版本信息

  • ProComponents 版本: [e.g. 4.0.0]
  • umi 版本
  • 浏览器环境
  • 开发环境 [e.g. mac OS]

🚑 其他信息

linxianxi avatar Jun 05 '24 07:06 linxianxi

看了一下代码这里可能不应该用 antd 的 CP 来配置 hashed 取而代之应该用 ProConfigProvider

import { ProConfigProvider } from 'from '@ant-design/pro-components';

Wxh16144 avatar Aug 06 '24 13:08 Wxh16144

ProLayout 现在没办法消费 antd ConfigProvider 里的自定义 token:https://github.com/ant-design/ant-design/issues/54730#issuecomment-3218766659

afc163 avatar Aug 25 '25 04:08 afc163