Where are you using the Tag?
Apr 4, 2019
7
Level 14
Make sure to provide the "name" option.
Hi, I'm trying to register a component with Vue I'm getting error that sound like this: app.js:38568 [Vue warn]: Unknown custom element: < replies > - did you register the component correctly? For recursive components, make sure to provide the "name" option.
found in
---> < ThreadView > < Root>
Here is the app.js file:
require('./bootstrap');
window.Vue = require('vue');
import Datepicker from './components/Datepicker.vue';
Vue.component('flash', require('./components/Flash.vue'));
Vue.component('thread-view', require('./pages/Thread.vue'));
const app = new Vue({
el: '#app',
components: {Datepicker}
});
Here is the Replies.vue file:
<template>
<div>
<div v-for="reply in items">
<reply :data="reply"></reply>
</div>
</div>
</template>
<script>
import Reply from './Reply.vue';
export default {
props: ['data'],
components: { Reply },
data() {
return {
items: this.data
}
}
}
</script>
And here is the Thread.vue (this file is not stored in components folder this is stored in js/pages)
<script>
import Replies from '../components/Replies.vue';
export default {
components: { Replies }
}
</script>
Level 6
@HJORTUR17 - Did you try to import the replies component in the app.js file and it failed? It should work if you do it like that
Please or to participate in this conversation.