Skip to content

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

@webvs2

Description

@webvs2
  • 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注册情况,也是如此,希望可以给到帮助

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions