Vue3中router-view
,keepAlive
,transition
嵌套使用。
<router-view v-slot="{ Component }">
<transition name="custom-classes" :duration="{ enter: 500, leave: 500 }" mode="out-in"
enter-active-class="animate__animated animate__zoomIn"
leave-active-class="animate__animated animate__zoomOut">
<KeepAlive>
<component :is="Component" />
</KeepAlive>
</transition>
</router-view>