[英][Vue warn]: Unknown custom element
我是vuejs的新手,在laravel框架中编写一个js代码时,出现错误:
[Vue warn]: Unknown custom element: <app> - did you register the component correctly? For recursive components, make sure to provide the "name" option.
App.js
import Vue from 'vue'
import Vcinfo from './Vcinfo.vue'
import router from './router'
const app = new Vue({
el: '#vcinfo',
components: { Vcinfo },
template: '<app></app>',
router
})
请建议该怎么办?
这是给将来的读者的。 我犯了一个错误,我不得不这样使用它。
import Vue from 'vue'
import Vcinfo from './Vcinfo.vue'
import router from './router'
const app = new Vue({
el: '#vcinfo',
components: { Vcinfo },
template: '<vcinfo></vcinfo>',
router
})
按照此导入import Vcinfo from './Vcinfo.vue'
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.