1

I am new to vuejs, While writing one js code inside laravel framework, I am getting error :

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

please suggest what to do?

1
  • 3
    Your template contains <app></app>, but you do not import a component called app. Commented Aug 29, 2017 at 2:20

1 Answer 1

1

This is for future reader. I made the mistake I had to use it like this.

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

as per this import import Vcinfo from './Vcinfo.vue'

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.