Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
4 of 5 tasks
MinMr opened this issue May 10, 2023 · 9 comments
Open
4 of 5 tasks

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

MinMr opened this issue May 10, 2023 · 9 comments

Comments

@MinMr
Copy link

MinMr commented May 10, 2023

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

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

lanseria commented May 12, 2023

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

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

@lishaobos
Copy link
Contributor

需要一个复现的 git 仓库

@maybeyj
Copy link

maybeyj commented Jun 17, 2023

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

@aibayanyu20
Copy link

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

@chenweiyi
Copy link

可以这么写

// 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
Copy link

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

@weiShaoY
Copy link

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

解决了没,大佬

@aibayanyu20
Copy link

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
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants