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

In the es file, Vue.use(ref, { name: 'ant-ref' }); error when registering the plugin #5307

Closed
1 task
webvs2 opened this issue Mar 5, 2022 · 3 comments
Closed
1 task
Labels

Comments

@webvs2
Copy link
Contributor

webvs2 commented Mar 5, 2022

  • I have searched the issues of this repository and believe that this is not a duplicate.

Version

3.0.0-beta.13

Environment

win10-64 Google Chrome 版本 98.0.4758.82(正式版本)64 位 vue 3.2

Reproduction link

https://github.com/webvs2/ant-but

Steps to reproduce

当我准备用vue-cli新建一个项目的时候,单纯选择了vue3创建成功,在vue ui中用vue-cli-plugin-ant-design插件自动化引入ant,成功安装后报错-Trigger.js?88ee:16 Uncaught TypeError: Cannot read properties of undefined (reading 'use')
at eval (Trigger.js?88ee:16:1)

What is expected?

没有报错,正常使用ant功能

What is actually happening?

报错:Trigger.js?88ee:16 Uncaught TypeError: Cannot read properties of undefined (reading 'use')
at eval (Trigger.js?88ee:16:1)


当我尝试解决问题的,发现你不能用import Vue from 'vue';来使用vue的use,这console了undefined,只有在vue应用中,就是mian.js里面创建的vue对象才能使用,如下:
let VueApp=createApp(App).use(router)
VueApp.use(ref, { name: 'ant-ref' });
VueApp.mount('#app')
我查看了vue-router注册情况,也是如此,希望可以给到帮助

@github-actions github-actions bot changed the title es文件里面 Vue.use(ref, { name: 'ant-ref' });注册插件报错 In the es file, Vue.use(ref, { name: 'ant-ref' }); error when registering the plugin Mar 5, 2022
@tangjinzhou
Copy link
Member

注意你的组件版本 ant-design-vue 2.0以上才支持 vue3

@webvs2
Copy link
Contributor Author

webvs2 commented Mar 7, 2022

谢谢哦,在vue-cli插件市场里面默认下载了1.7版本,需要升级,我会去反馈的

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 11, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants