VueJS-[Vue警告]:无法安装组件:模板或渲染函数未定义

时间:2018-09-29 06:41:23

标签: webpack vuejs2 vue-component vue-loader vue-cli-3

我正在尝试制作一个vue组件,该组件是Owl Carousel的包装。 但是,当我尝试将此组件用于另一个组件时,出现错误消息, [Vue warn]: Failed to mount component: template or render function not defined.

Link到我的github存储库。

这是我如何将该组件用于另一个组件

import Carousel from 'v-owl-carousel'

export default {
  name: 'app',
  components: {
    Carousel
  }
}

<Carousel :autoplay="true">
    <img src="https://placeimg.com/200/200/any?1">
    <img src="https://placeimg.com/200/200/any?2">
    <img src="https://placeimg.com/200/200/any?3">
    <img src="https://placeimg.com/200/200/any?4">
</Carousel>

这是整个错误跟踪,

log.js?1afd:24 [HMR] Waiting for update signal from WDS...
vue.runtime.esm.js?2b0e:587 [Vue warn]: Failed to mount component: template or render function not defined.

found in

---> <Carousel>
       <App> at src/App.vue
         <Root>
warn @ vue.runtime.esm.js?2b0e:587
mountComponent @ vue.runtime.esm.js?2b0e:2754
Vue.$mount @ vue.runtime.esm.js?2b0e:7995
init @ vue.runtime.esm.js?2b0e:4133
createComponent @ vue.runtime.esm.js?2b0e:5604
createElm @ vue.runtime.esm.js?2b0e:5551
createChildren @ vue.runtime.esm.js?2b0e:5678
createElm @ vue.runtime.esm.js?2b0e:5580
patch @ vue.runtime.esm.js?2b0e:6087
Vue._update @ vue.runtime.esm.js?2b0e:2656
updateComponent @ vue.runtime.esm.js?2b0e:2784
get @ vue.runtime.esm.js?2b0e:3138
Watcher @ vue.runtime.esm.js?2b0e:3127
mountComponent @ vue.runtime.esm.js?2b0e:2791
Vue.$mount @ vue.runtime.esm.js?2b0e:7995
init @ vue.runtime.esm.js?2b0e:4133
createComponent @ vue.runtime.esm.js?2b0e:5604
createElm @ vue.runtime.esm.js?2b0e:5551
patch @ vue.runtime.esm.js?2b0e:6126
Vue._update @ vue.runtime.esm.js?2b0e:2656
updateComponent @ vue.runtime.esm.js?2b0e:2784
get @ vue.runtime.esm.js?2b0e:3138
Watcher @ vue.runtime.esm.js?2b0e:3127
mountComponent @ vue.runtime.esm.js?2b0e:2791
Vue.$mount @ vue.runtime.esm.js?2b0e:7995
(anonymous) @ main.js?56d7:6
./src/main.js @ app.js:1919
__webpack_require__ @ app.js:725
fn @ app.js:102
0 @ app.js:1932
__webpack_require__ @ app.js:725
(anonymous) @ app.js:792
(anonymous) @ app.js:795
vue.runtime.esm.js?2b0e:8010 Download the Vue Devtools extension for a better development experience:
https://github.com/vuejs/vue-devtools

谢谢。

0 个答案:

没有答案