Ich habe versucht, eine Listenanimation ähnlich wie in https://stripe.com/radar (Überprüfung gekennzeichnete Zahlungen) zu erstellen. Karten scrollen vertikal nacheinander. Jede Karte stammt aus einem Array.VueJS 2 List Animation Funktioniert nicht wie erwartet mit dem Transitionsnamen
Ich habe es implementiert und es funktioniert gut. Die Animation ist jedoch nicht glatt. Es sieht so aus, als ob der Animationsname = "animate" in der Übergangsgruppe nicht funktioniert.
Versucht alles wie in der Dokumentation. Es kann keine Lösung
https://jsfiddle.net/0aLfzs9u/
<div class="container" id="vue-instance">
<transition-group name="animate">
<div class="row align-items-center quote" :class="{active: key==1 }" @click="items.pop()" v-for="(item,key) in items" :key="item">
<div class="col-4 mt-3 mb-3">
<p>{{item}} Cement</p>
<small>75 bags</small>
</div>
<div class="col-7">
<p>Thrissur</p>
<small>12 hours ago</small>
</div>
<div class="col-1">
<i class="fa fa-check"></i>
</div>
</div>
</transition-group>
<p>
some footer content
</p>
</div>
var vm = new Vue({
el: '#vue-instance',
data: {
items: [1,2,3]
},
created() {
let self = this
setInterval(function() {
self.items.pop();
self.items.splice(0, 0, Math.floor((Math.random()*100)+1));
}, 2000);
}
});
.animate-enter-active,
.animate-leave-active{
transition: all 2s;
max-height: 230px;
opacity:1;
}
.animate-enter,
.animate-leave-to{
transition: all 2s;
max-height: 0px;
overflow:hidden;
}
.quote {
box-shadow: 0 4px 6px rgba(50, 50, 93, .11), 0 1px 3px rgba(0, 0, 0, .08);
border-radius: 4px;
background-color: white;
filter: blur(3px);
transform: scale(.95);
transition: all 1s;
}
.active {
filter: blur(0px);
transform: scale(1);
transition: all 1s;
}
Ist das Ihr Problem beheben? https://jsfiddle.net/0aLfzs9u/2/ –
Ich habe das schon einmal probiert. Es ist keine gute Lösung. Denn im mobilen Bereich kann sich die Höhe ändern. Versuchen Sie, die Breite zu verringern, es bricht zusammen –