W
W
WebDev2017-08-23 21:46:45
Vue.js
WebDev, 2017-08-23 21:46:45

How to make animation on transition in vue?

Let's say there are 2 pages, how to make it so that when switching to the second one, the first one leaves to the left and at the same time the second one leaves to the right and, as it were, pushes the first one out.
I'm trying to use a transition, but instead of what I want, the first page leaves, and then, when it is completely hidden, the second page suddenly appears.
Has anyone done something similar? Share a code example, please.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
E
Evgeny Kulakov, 2017-08-23
@kulakoff Vue.js

The transition has a mode="out-in" attribute for just such purposes.

A
Alexander, 2017-08-23
@boratsagdiev

You need the Animated Transitions section of the documentation, specifically the section on transition classes.
The bottom line is that you need to describe the animation of the appearance, disappearance and intermediate stages of the component with special classes, of which there are only 6. If your animation is called fade, then the class names will be: fade-enter-active , fade-leave-active , etc.
Take some ready-made example (or modify your own) and tweak the css properties in it, practice.
Here is a good example .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question