vue transitions on an element using computed

Viewed 95

I have some text which is rendered via a computed property. Is there a a way to change the transition out delay to the transition in delay using the Vue transition tag, apart from using transition: all 0.5s on the element?

1 Answers

Vue offers transition modes for out-in and in-out

in-out: New element transitions in first, then when complete, the current element transitions out.

out-in: Current element transitions out first, then when complete, the new element transitions in.

Now let’s update the transition for our on/off buttons with out-in:

<transition name="fade" mode="out-in">
  <!-- ... computed prop ... -->
</transition>

The in-out mode isn’t used as often, but can sometimes be useful for a slightly different transition effect.

Source: https://v2.vuejs.org/v2/guide/transitions.html#Transition-Modes

Related