foreign-admin-ui/src/App.vue

51 lines
1.0 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<template>
<!-- 动态绑定 Transition name -->
<router-view v-slot="{ Component }">
<transition name="route-fade" mode="out-in" appear>
<component :is="Component" />
</transition>
</router-view>
</template>
<script setup lang="ts">
</script>
<style scoped lang="scss">
/* 过渡动画的 CSS 前缀和 Transition name 一致 */
/* 进入动画开始 */
.route-fade-enter-from {
opacity: 0;
transform: translateX(20px);
/* 可选从右侧滑入 */
}
/* 进入动画过程 */
.route-fade-enter-active {
transition: all 0.3s ease;
/* 动画时长和缓动效果 */
}
/* 进入动画结束 */
.route-fade-enter-to {
opacity: 1;
transform: translateX(0);
}
/* 离开动画开始 */
.route-fade-leave-from {
opacity: 1;
transform: translateX(0);
}
/* 离开动画过程 */
.route-fade-leave-active {
transition: all 0.3s ease;
}
/* 离开动画结束 */
.route-fade-leave-to {
opacity: 0;
transform: translateX(-20px);
/* 可选向左侧滑出 */
}
</style>