Answer the question
In order to leave comments, you need to log in
How to delay animation of transition element?
The bottom line is that there are 3 blocks, they have one animation, when you open the page using the property appear
, these animations work immediately, but you need them to work in turn.
That is, the first, after 1s the second, after 2s the third. I can't figure out how to implement it. How to "tell" the transition element that the start should be delayed by n seconds.
Answer the question
In order to leave comments, you need to log in
Render elements with a delay :
data: () => ({
items: [
{ show: false, ... },
{ show: false, ... },
...
],
}),
computed: {
showItems() {
return this.items.filter(n => n.show);
},
},
mounted() {
this.items.forEach((n, i) => setTimeout(() => n.show = true, i * 1000));
},
<transition-group name="fade">
<div v-for="n in showItems" :key="n.id">{{ n }}</div>
</transition-group>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question