There is a NavMenu and a Main component.Once I click the the menu,I want to create a component in the Main component.
And I don't know what component will be created until it is clicked.
main.vue:
<el-tabs v-model='xxx'>
<el-tab-pane>[there will be the component]</el-tab-pane>
</el-tabs>
What should I do ?
Can I use the variable name to create a component?
Dynamic Components
Learn more Dynamic Components
here
You can use attribute is
to create a dynamic component.
Learn more :it
here
<component v-bind:is="currentTabComponent"></component>