2017-08-29 92 views
-1

我是新来vuejs,一边写laravel框架内的一个js代码,我得到错误:[Vue公司提醒]:未知的自定义元素

[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 
}) 

请建议做什么?

+3

你的模板中包含'',但你不导入一个名为'app'组件。 – Bert

回答

0

这是给未来的读者。 我犯了这个错误,我不得不这样使用它。

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'