D
D
Dmitry2021-11-07 14:09:17
Vue.js
Dmitry, 2021-11-07 14:09:17

Why doesn't dynamic transiton duration enter work?

Vue 3
I want to add the ability to control the route change animation
In routes.js I added the transition config

{
  ...,
  meta: {
    transition: {
      name: 'transition name',
      mode: 'out-in',
      duration: {
        enter: 1000,
        leave: 2000
      }
    }
}


I substitute in the template
<router-view v-slot="{ Component, route }">
  <transition v-bind="route.meta.transition">
    <component :is="Component" />
  </transition>
</router-view>


As a result, only leave works, but enter does not

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question