It appears that Vue lacks built-in support for the defer transition technique known as cross-fade. However, you can utilize <transition-group> to achieve similar effects.
Below is the implementation in Vue. The crossfade effects are implemented using setTimeout and FLIP techniques.
The fundamental concept involves recording positions for both the sending and receiving elements, and deferring the transition with setTimeout (necessary for utilizing FLIP technique).
Check out the final effects on CodePen.
<!-- Utilize preprocessors with the lang attribute! Example: <template lang="pug"> -->
<template>
<div id="flip-list-demo" class="demo">
<button @click="shuffle">shuffle</button>
<input type="text" @keyup.enter="add" />
<div style="display: flex; flex-direction: row">
<transition-group
@before-enter="beforeEnter"
@enter="enter"
@leave="leave"
name="list"
tag="div"
>
<li
class="list-item"
v-for="(item, index) in validList"
v-bind:key="item.value"
:ref="item.value"
@click="goInvalid"
:data-item="item.value"
>
{{ item.value }}
</li>
</transition-group>
<transition-group
name="list"
@before-enter="beforeEnter"
@enter="enter"
@leave="leave"
tag="div"
>
<li
:ref="item.value"
class="list-item"
v-for="(item, index) in invalidList"
:key="item.value"
@click="goValid"
:data-item="item.value"
>
{{ item.value }}
</li>
</transition-group>
</div>
</div>
</template>
<script>
// JavaScript logic here...
</script>
<style>
.list-item {
transition: all 500ms;
border: 1px solid #111111;
height: 50px;
width: 100px;
margin: 10px 10px;
}
.list-leave-active {
position: absolute;
}
</style>
View the complete code and effects on CodePen.