console
new Vue({
el: '#demo',
data: {
show: true,
list:[1]
}
})
<div id="demo">
<button v-on:click="list.push(+new Date())">
添加
</button>
<button v-on:click="list.pop()">
移除
</button>
<transition-group tag="ul" >
<li v-for="item of list" :key="item">hellohellohellohellohellohellohelloh
ellohellohellohellohellohellohellohellohellohell
ohellohellohello</li>
</transition-group>
</div>
.v-enter-active{
transition: all 1s;
}
.v-leave-active {
transition: all 1s;
}
.v-enter, .v-leave-to {
opacity: 0;
transform: translateX(100px);
}
.v-item {
display: inline-block;
margin-right: 10px;
}
@keyframes bounce-in {
0% {
transform: translateX(0);
}
100% {
transform: translateX(-500px);
}
}