|
@@ -379,10 +379,14 @@ const router=createRouter({
|
|
|
history:createWebHistory(import.meta.env.VITE_APP_BASE_URL),
|
|
|
routes,
|
|
|
scrollBehavior(to, from, savedPosition){
|
|
|
- if (savedPosition) {
|
|
|
+ if (savedPosition&&to.meta.keepAlive) {
|
|
|
return savedPosition
|
|
|
} else {
|
|
|
- return { top: 0 }
|
|
|
+ return new Promise((resolve)=>{
|
|
|
+ setTimeout(() => {
|
|
|
+ resolve({left:0,top:0})
|
|
|
+ }, 0);
|
|
|
+ })
|
|
|
}
|
|
|
}
|
|
|
})
|