Vue3.0如何引入插件?
来源:8-11 作业:注册页面的编写

linkscope
2020-10-07
Vue2中可以直接使用Vue.use方式引入插件,但在Vue3.0中如何使用?
我现在想调用vue-lazyload,但在createApp实例化的对象使用use报错
Argument of type 'VueLazyloadPluginObject' is not assignable to parameter of type 'Plugin_2'
Property 'install' is missing in type 'VueLazyloadPluginObject' but required in type '{ install: PluginInstallFunction; }'.ts(2345)
写回答
1回答
-
同学你好 vue3 也是采用 在实例上 use 引入插件的,比如 vuex 和 vue-router 都是这种方式,但是现在 vue2 的一些插件是不兼容 vue3 的,所以你这里这个 vue-lazyload 是不支持 vue3 的,你只能等这些插件升级以后适配 vue3
00
相似问题