Answers for "vue router transition"

0

vuejs transition to switch between pages

<!-- App.vue -->
<router-view v-slot="{ Component }">
  	<transition name="slither" mode="in-out">
    	<component :is="Component"></component>
	</transition>
</router-view>
Posted by: Guest on December-21-2020
0

vue router transition

// then, in the parent component,
// watch the `$route` to determine the transition to use
watch: {
  '$route' (to, from) {
    const toDepth = to.path.split('/').length
    const fromDepth = from.path.split('/').length
    this.transitionName = toDepth < fromDepth ? 'slide-right' : 'slide-left'
  }
}
Posted by: Guest on August-02-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language