the same file will not be re-rendered and loaded on different routes, nor will v-if, the purpose of re-rendering. In order to switch the animation is effective. two The data can be displayed differently according to the data I pass, and the style is the same.
< transition name= "fade" mode= "out-in" >
<router-view>
</router-view>
< / transition >
import index from"@ / pages/index.vue";
children: [
{
path: "path1",
component: index
},
{
path: "path2",
component: index
},
]