[question] I would like to ask about the animation of page switching in vue.

other pages are normal when the page is switched, but when the browsing history returns to the personal page

the orange part of the page switching animation will be stuck at the bottom for about 0.2s and then
bounce to the top, instead of sliding around as other pages normally switch

.

the following is the CSS code for switching animation

.Router {

transition: all 0.4s ease;
-webkit-overflow-scrolling: touch;

}

.resume-left-enter,
.notify-right-leave-active {

opacity: 0;
-webkit-transform: translate(-100%, 0);
transform: translate(-100%, 0);

}

.resume-right-enter,
.notify-left-leave-active {

opacity: 0;
-webkit-transform: translate(100%, 0);
transform: translate(100%, 0);

}

Nov.26,2021

is the orange part a picture? Change the picture to div+css;


solved the problem

seems to slide the original page is also display:block (exclusive one line), so the new page will be topped

you need to add a relative positioning when you are writing the switching CSS animation

here is the animation code

.slide-right-enter-active,
.slide-right-leave-active,
.slide-left-enter-active,
.slide-left-leave-active {
  will-change: transform;
  transition: all 500ms;
  ***position: absolute;***
}
.slide-right-enter {
  opacity: 0;
  transform: translate3d(-100%, 0, 0);
}
.slide-right-leave-active {
  opacity: 0;
  transform: translate3d(100%, 0, 0);
}
.slide-left-enter {
  opacity: 0;
  transform: translate3d(100%, 0, 0);
}
.slide-left-leave-active {
  opacity: 0;
  transform: translate3d(-100%, 0, 0);
}

Menu