I can't write transition on router-view like <router-view transition ="fade">`
so, how to use transition on this case?
Transitions are supported in <router-view></router-view>. This is a working example from my code:
<router-view transition="fade" transition-mode="out-in" class="animated"></router-view> using Animate.css and my transition registered as this:
Vue.transition('fade', { enterClass: 'fadeIn', leaveClass: 'fadeOut'})
It's also stated in the documentation: http://vuejs.github.io/vue-router/en/view.html
Thank you sagaio!
And I found the router configuration "transitionOnLoad" for this case
Where should I put this line?
Vue.transition('fade', { enterClass: 'fadeIn', leaveClass: 'fadeOut'})
I want the transition for all of my routes.
@Wipsly just in the main.js, if you create the project by vue-cli.
Closing since the issue is resolved.
very nice!
Most helpful comment
Transitions are supported in
<router-view></router-view>. This is a working example from my code:<router-view transition="fade" transition-mode="out-in" class="animated"></router-view>using Animate.css and my transition registered as this:Vue.transition('fade', { enterClass: 'fadeIn', leaveClass: 'fadeOut'})It's also stated in the documentation: http://vuejs.github.io/vue-router/en/view.html