pageTransition used in vue3 and nuxt.
When I moved to the next page, I switched the screen to translateX.
However, as the screen moves, empty space occurs as much as the value of translateX.
I want to solve this.
<template>
<NuxtLayout>
<NuxtPage />
</NuxtLayout>
</template>
<style>
.page-enter-active,
.page-leave-active {
transition:transform 0.4s linear;
}
.page-enter-from {
transform: translateX(100%);
}
.page-enter-to {
opacity: 1;
transform: translateX(0);
}
.page-leave-from {
opacity: 1;
transform: translateX(-100%);
}
.page-leave-to {
opacity: 0;
transform: translateX(0);
}
</style>
I would try change the leave-from and leave-to with the correct order, and replace the
transition:transform 0.4s linear;toeaseand check about empty spaces, block horizontal scrolling issues during the transition, by: