When switching routes, the previous page has a height, so switch to the next page with a disordered style

     
        <transition name="fade">
            <router-view></router-view>
        </transition>
        
        

style
.fade-enter-active, .fade-leave-active {
transition: opacity .5s;
}
.fade-enter, .fade-leave-to / .fade-leave-active below version 2.1.8 / {
opacity: 0;
}

Mar.16,2021

if transition is used, when switching routes, both pages will exist in the document at the same time, so the phenomenon you mentioned appears.
just let them stack up.

,:


const router = new VueRouter({
  routes,
  scrollBehavior(to, from, savedPosition) {
    return {
      x: 0,
      y: 0
    }
  }
})
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3c224-2c319.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3c224-2c319.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?