vueComponent / ant-design-vue

🌈 An enterprise-class UI components based on Ant Design and Vue. 🐜
https://antdv.com/
Other
20.36k stars 3.8k forks source link

config provider scope错误 #7885

Open unknowntocka opened 1 month ago

unknowntocka commented 1 month ago

Version

4.2.5

Environment

vue3.5.12, antv4.2.5

Reproduction link

Edit on CodeSandbox

Steps to reproduce

使用config provider包裹组件并传入属性会影响一切而不是只影响被包裹的组件

What is expected?

应该只影响被包裹的组件

What is actually happening?

对比参考 参考 antd :https://codesandbox.io/p/sandbox/mxj3jf?file=%2Fsrc%2FApp.tsx%3A9%2C19

unknowntocka commented 1 month ago

企业微信截图_17295913116058 antdv

unknowntocka commented 1 month ago

企业微信截图_17295913183942 antd

unknowntocka commented 1 month ago

@aibayanyu20 @tangjinzhou 大佬麻烦看看

cc-hearts commented 1 month ago

组件覆盖的写法是

:theme="{
      components: {
        Button: {
          colorPrimary: '#ccc',
          fontSize: 16,
        },
      },
    }"

没有 token 下 components 的写法吧

:theme="{
      token: {
        components: {
          Button: {
            colorPrimary: '#ccc',
            fontSize: 16,
          },
        },
      },
    }"
unknowntocka commented 1 month ago

组件覆盖的写法是

:theme="{
      components: {
        Button: {
          colorPrimary: '#ccc',
          fontSize: 16,
        },
      },
    }"

没有 token 下 components 的写法吧

:theme="{
      token: {
        components: {
          Button: {
            colorPrimary: '#ccc',
            fontSize: 16,
          },
        },
      },
    }"

我的 我当时测试的时候修改了一点playground的代码来看是不是要用组件覆盖的方式才行,你看我贴的图上的代码就行,和组件覆盖无关

shuipinhuajieyu commented 1 month ago

比较奇怪的是,我看codesandbox的demo确实有问题 但是我拉了antdv仓库 跑那个fast-dev 里面展示是正常的?

unknowntocka commented 1 week ago

所以这个issue的结局是要等时间到被机器人关闭了吗