[Vuejs]-Recommended way of conditionally rendering custom Vue components

0👍

If you’ve the component names, you could just use the built-in component tag to render the component dynamically :

<component :is="dynamicName" />

instead of :

 <template v-if="dynamicName==='abc'">
    <abc/>
 </template>
 <template v-elseif="dynamicName==='xyz'">
    <xyz/>
 </template>
....

Leave a comment