Added animation to page change

This commit is contained in:
2025-10-21 10:38:28 +03:30
parent 29392d8a64
commit d53762ffa2

View File

@@ -6,7 +6,26 @@ import NavBar from './components/NavBar.vue'
<template>
<NavBar />
<RouterView />
<RouterView v-slot="{ Component, route }">
<transition name="page" mode="out-in">
<component :is="Component" :key="route.path" />
</transition>
</RouterView>
</template>
<style scoped></style>
<style scoped>
.page-enter-active,
.page-leave-active {
transition: all 0.2s ease;
}
.page-enter-from {
opacity: 0;
transform: translateX(20px);
}
.page-leave-to {
opacity: 0;
transform: translateX(-20px);
}
</style>