[英][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.