unplugin / unplugin-vue-components

📲 On-demand components auto importing for Vue
https://www.npmjs.com/package/unplugin-vue-components
MIT License
3.77k stars 349 forks source link

ant-design-vue v4版本新增组件自动导入不生效 #631

Open MinMr opened 1 year ago

MinMr commented 1 year ago

Describe the bug

ant-design-vue 在v4版本中新增的组件Watermark、FloatButton、QRCode、Segmented 无法自动导入,其它组件能正常自动导入

unplugin-vue-components 版本:0.24.1 ant-desing-vue版本: 4.0.0-beta.2 vue版本:3.3.0-beta.5

vite.config.ts 插件配置: Components({ dirs: ['src/components'], directoryAsNamespace: true, dts: 'types/components.d.ts', resolvers: [ AntDesignVueResolver({ importStyle: false }) ] }),

Reproduction

no

System Info

mac

Used Package Manager

yarn

Validations

lanseria commented 1 year ago

_同,我用arco-ui也是不会自动生成,之前的项目删除后也不会自己生成了,不知道哪个问题。只有当前自己的组件才会自动生成

不过好像引用了一次就好了。。🙃

lishaobos commented 1 year ago

需要一个复现的 git 仓库

maybeyj commented 1 year ago

antdesign4的新组件确实不会自动导入了

aibayanyu20 commented 1 year ago

可以暂时先用antdv-component-resolver 这个resolver

chenweiyi commented 1 year ago

可以这么写

// vite.config.js
import { defineConfig } from 'vite';
import Components from 'unplugin-vue-components/vite';
import { AntDesignVueResolver } from 'unplugin-vue-components/resolvers';
export default defineConfig({
  plugins: [
    // ...
    Components({
      resolvers: [
        AntDesignVueResolver({
          importStyle: false, // css in js
        }),
      ],
    }),
  ],
});
liu-huitao commented 1 year ago

The problem is the same as before, which great god can come out and solve it

weiShaoY commented 1 year ago

The problem is the same as before, which great god can come out and solve it

解决了没,大佬

aibayanyu20 commented 1 year ago

The problem is the same as before, which great god can come out and solve it

解决了没,大佬

看样子是还没有发版,可以先用这个库,https://www.npmjs.com/package/antdv-component-resolver

Qing-Elsevier commented 2 months ago

The problem is the same as before, which great god can come out and solve it

解决了没,大佬

看样子是还没有发版,可以先用这个库,https://www.npmjs.com/package/antdv-component-resolver

也没有用啊

[Vue warn]: Failed to resolve component: a-avatar