Vue 的 <Transition> 如何做进出场动画?有哪些钩子和类名?
<Transition> 给单个元素/组件的插入、更新、移除自动添加 CSS 过渡类名:
v-enter-from → v-enter-active → v-enter-to (进入)
v-leave-from → v-leave-active → v-leave-to (离开)<Transition name="fade">
<p v-if="show">hello</p>
</Transition>
<style>
.fade-enter-active, .fade-leave-active { transition: opacity .3s }
.fade-enter-from, .fade-leave-to { opacity: 0 }
</style>多个元素用 <TransitionGroup>(需 key)。也可配合 JS 钩子 @enter / @leave 用 GSAP 等库做复杂动画。列表整体过渡注意 FLIP 动画。