Route Transitions and Animation
RouterView with Transition, transition-name based on route, slide/fade between routes.
Animating Between Routes
When the URL changes, the matched component swaps instantly. By wrapping the view in Vue's Transition, you can fade or slide between pages for a smoother feel.
RouterView With v-slot
To animate, you need access to the resolved component. The scoped slot form of RouterView exposes Component and route.
<RouterView v-slot="{ Component }">
<component :is="Component" />
</RouterView>All lessons in this course
- Route Meta Fields and Typing
- Route Transitions and Animation
- Scroll Behavior Configuration
- Programmatic Navigation and useRouter