nuxt引入之后报错
llc1994 opened this issue · 4 comments
llc1994 commented
nuxt引入这个组件后报错
控制台报错 Cannot read property '_init' of null at r (vue.runtime.esm.js?2b0e:5154)
at Function.Vue.use (vue.runtime.esm.js?2b0e:5109)
at eval (vue-slider-component.js?d2f6:12)
at Module../plugins/vue-slider-component.js (app.js:541)
at webpack_require (runtime.js:854)
at fn (runtime.js:151)
at eval (index.js:51)
at Module../.nuxt/index.js (app.js:215)
at webpack_require (runtime.js:854)
at fn (runtime.js:151)
我在plugins/vue-slider-component.js文件里的写法
import Vue from 'vue';
import VueSlider from 'vue-slider-component'
import 'vue-slider-component/theme/default.css'
Vue.use(VueSlider)
用的时候报错了, 求大佬帮助
NightCatSama commented
Vue.use 是用来加载插件的吧。
加载组件用的是 Vue.component('VueSlider', VueSlider)
llc1994 commented
emmmmmm nuxt新手 好像nuxt不支持这么写
NightCatSama commented
llc1994 commented
好的 谢谢 已经解决了