I'm building my first app with Vue.js 2, and can't figure out the error.
I'm using full build (webpack.config.js
):
resolve: {
alias: {
'vue$': 'vue/dist/vue.js',
"vueRouter$": "vue-router/dist/vue-router.js"
},
extensions: ['*', '.js', '.vue', '.json']
},
My html:
<div id="app">
<adv-component></adv-component>
</div>
My main.js
:
const Vue = require('vue');
var vueComponent = require('./component.vue');
var app = new Vue({
el: '#app',
data: {
},
// Local registration
components: {
'adv-component': vueComponent,
}
});
component.vue
:
<template id='asd'>
<div>
Hello Single File Component!
</div>
</template>
<script>
export default {
data () {
return 0;
}
}
</script>
The error:
[Vue warn]: Failed to mount component: template or render function not defined.
found in
---> <AdvComponent>
How can I fix the error?