I'm trying to figure out how to conditionally load sub/child component from Laravel's blade template
I have a main container, which is being called from the blade:
<structure-container view='menu-index'></structure-container>Here is the StructureContainer.vue
<template> <div> //I can have if-else statement here by "view", but looking for a better solution <menu-index></menu-index> </div>export default{ components: { 'menu-index': require('./menu/IndexComponent.vue'), 'test': require('./menu/TestComponent.vue'), }, props: ['view'] }
As you can see I have two child components: menu-index & test. I want to pass the parameter from blade and display the corresponding component. Can I avoid if-else statements? there should be a better way to do this