vue.js multiple transitions for a router-view

。_饼干妹妹 提交于 2020-01-13 19:11:07

问题


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?


回答1:


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'
  }
})


来源:https://stackoverflow.com/questions/38776733/vue-js-multiple-transitions-for-a-router-view

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!