vue 3.0 router 跳转动画

<router-view class="router-view" v-slot="{ Component }">
    <transition name="fade-transform" mode="out-in">
        <component :is="Component" />
    </transition>
</router-view>

 

CSS

.fade-transform-leave-active,
.fade-transform-enter-active {
	transition: all 0.5s;
}
.fade-transform-enter {
	opacity: 0;
	transform: translateX(-30px);
}
.fade-transform-leave-to {
	opacity: 0;
	transform: translateX(30px);
}

  

posted @ 2021-05-19 14:32  First·林肯  阅读(997)  评论(0编辑  收藏  举报