Vue realizes tab switching and retains original data

vue makes a tab switch, switching content to several list pages with the same style, but rendering data differently. I want to use a component and then request data and render according to the different parameters passed. How should I write

?
Sep.01,2021

you can write a common component, and then wrap different tab to different outer layers, and pass different type to the common component through props.
tab switching is generally used

.

< component: is= "current component" / >

The value in

is must be changed, otherwise the component will not be refreshed

Common components

component A:

<div>
    < :type="A">
</div>

component B:

<div>
    < :type="B">
</div>

when you click on a different tab, just change the value of is to a different component


use slots. I won't study the official documents of vue, and I can't teach you

.
Menu