I am using Vue.JS in a project where I am trying to load a custom component tag.
We have used Vue.JS in other projects before so I basically copy pasted it into a new project though it is not working, so I assume that I missed something...
My browser console returns this error: console error image
The code below is from my app.js
import Vue from 'vue';
import Insights from './components/insight-list.vue';
Vue.config.productionTip = false;
new Vue({
el: '#roots',
components: {
Insights
}
});
And this code is from my vue component (insight-list.vue)
<template>
<div class="insight-list">
<h1>Hello world</h1>
</div>
</template>
<script>
export default {
name: 'insight-list',
props: [
],
computed: {
},
methods: {
},
components: {
}
}
</script>
So here remains my question, what did I do wrong / what didn't I do yet?
I think you should try
new Vue({
el: '#roots',
components: {
'insight-list': Insights
}
});
source: https://vuejs.org/v2/guide/components-registration.html
"For each property in the components object, the key will be the name of the custom element, while the value will contain the options object for the component."