I have the main Component using the Parent component having a dynamic component using the v-bind:is="componentName" just like:
Parent template:
<li class='list-inline-item g-mx-4 g-mt-10'>
<component v-bind:is="componentName"></component>
</li>
and code:
export default {
data: function(){
return {
componentName : "componentA"
},
},
components: {
componentA: {
template : "<div>A</div>"
},
componentB: {
template : " <div>B</div>"
}
}
I would like to switch the component to show sending a new value to componentName from a child component but I'm not sure if I have to use emit or watch or...?
I would like to do that without vuex.