How to change property value only when transition completed? #7415
-
I have Lottie's animation with the transition. And I want to pause this animation only when the transition is completed. <Transition>
<Lottie ref="SnowFlakes" :animationData="SnowFlakes_Json" style="position: absolute;
width: 125%; left: 0%; top: 0%; "
v-show="BellOfHappiness_playState"
:pauseAnimation="!BellOfHappiness_playState" // pauses the animation immediately, I want to pause it only after the transition completed
/>
</Transition>
Now I do not pause hidden animation at all, but it consumes processor resources when animation is hidden. How I can implement the TRANSITION_IS_COMPLETED predicate? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
<Transition @after-enter="handleAfterEnter">
<Lottie ref="SnowFlakes" :animationData="SnowFlakes_Json" style="position: absolute;
width: 125%; left: 0%; top: 0%; "
/>
</Transition>
<script setup>
import { ref } from 'vue'
const SnowFlakes= ref(null)
function handleAfterEnter() {
SnowFlakes.value?.pause()
}
</script> |
Beta Was this translation helpful? Give feedback.
Transition Hooks