B
B
ByJumping2022-03-24 11:24:23
css
ByJumping, 2022-03-24 11:24:23

How to properly animate Vue 2 elements?

I'm trying to animate routes using

<transition name="fade">
      <div class="content">
        <router-view />
      </div>
      </transition>


the styles themselves
.fade-enter-active,
.fade-leave-active {
  transition: opacity 0.5s ease;
}

.fade-enter,
.fade-leave-to {
  opacity: 0;
}


Everything is as per the guide, the animation goes only when the route is closed. When you open the page appears immediately

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton Anton, 2022-03-24
@ByJumping

https://ru.vuejs.org/v2/guide/transitions.html#%D0...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question