I am struggling with creating a recursive custom component that calls itself. Unfortunately, I keep encountering an error.
An unknown custom element: <TestRec> - have you registered the component correctly? For recursive components, ensure to specify the "name" option.
Even though I have provided a name option as shown below, the issue persists.
Do you have any insights on what might be causing this error?
<template>
<div>
<h4>I have developed a component capable of calling itself below</h4>
<v-select :items="['TestRec', 'normal']" v-model="comp"></v-select>
<hr />
<component :is="comp"></component>
</div>
</template>
<script>
import TestRec from "./TestRec";
export default {
name: 'New-Test-Rec', //Tried using 'Test-Rec' as well, but faced the same issue
components: {
TestRec
},
data(){
return {
comp: null
}
}
}
</script>