user3163681
user3163681

Reputation: 33

vue.js multiple transitions for a router-view

If I have a vue-router 'router-view' element defined like this:

<router-view transition="slide">

Is there a way to change the transition to a 'fade' when a specific route is called?

Upvotes: 2

Views: 2065

Answers (1)

Sven
Sven

Reputation: 153

Use a dynamic binding fopr transition:

<router-view :transition="$route.transition">

And set the data of transition from your route data

router.map({
  '/specialroute': {
    component: { ... },
    transition: 'fade'
  }
})

Upvotes: 3

Related Questions