You'd want to use :key
along with a <transition>
. Here's a very basic demo.
<transition name="slide-fade" mode="out-in">
<div :key="value">
{{ value }}
</div>
</transition>
Then, as value
changes the slide-fade
animation will be used. An element with the old value will use the leave
animation and the element with the new value will use the enter
animation.
Here's a quick demo: https://jsfiddle.net/jx52bfpc/2/
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…