ant-design-vue v4版本新增组件自动导入不生效
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.
_同,我用arco-ui也是不会自动生成,之前的项目删除后也不会自己生成了,不知道哪个问题。只有当前自己的组件才会自动生成
不过好像引用了一次就好了。。🙃
需要一个复现的 git 仓库
antdesign4的新组件确实不会自动导入了
可以暂时先用antdv-component-resolver 这个resolver
可以这么写
// 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
}),
],
}),
],
});
The problem is the same as before, which great god can come out and solve it
The problem is the same as before, which great god can come out and solve it
解决了没,大佬
The problem is the same as before, which great god can come out and solve it
解决了没,大佬
看样子是还没有发版,可以先用这个库,https://www.npmjs.com/package/antdv-component-resolver
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