unplugin-vue-components icon indicating copy to clipboard operation
unplugin-vue-components copied to clipboard

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

Open MinMr opened this issue 2 years ago • 9 comments

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

  • [X] Follow our Code of Conduct
  • [X] Read the Contributing Guide.
  • [ ] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • [X] Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead.
  • [X] The provided reproduction is a minimal reproducible of the bug.

MinMr avatar May 10 '23 09:05 MinMr

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

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

lanseria avatar May 12 '23 05:05 lanseria

需要一个复现的 git 仓库

lishaobos avatar May 31 '23 03:05 lishaobos

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

maybeyj avatar Jun 17 '23 14:06 maybeyj

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

aibayanyu20 avatar Jul 05 '23 23:07 aibayanyu20

可以这么写

// 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
        }),
      ],
    }),
  ],
});

chenweiyi avatar Jul 14 '23 08:07 chenweiyi

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

liu-huitao avatar Aug 22 '23 09:08 liu-huitao

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

解决了没,大佬

weiShaoY avatar Aug 25 '23 09:08 weiShaoY

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

解决了没,大佬

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

aibayanyu20 avatar Aug 25 '23 09:08 aibayanyu20

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

Qing-Elsevier avatar Jul 18 '24 07:07 Qing-Elsevier