|
@@ -377,7 +377,14 @@ const routes=[
|
|
|
|
|
|
const router=createRouter({
|
|
|
history:createWebHistory(import.meta.env.VITE_APP_BASE_URL),
|
|
|
- routes
|
|
|
+ routes,
|
|
|
+ scrollBehavior(to, from, savedPosition){
|
|
|
+ if (savedPosition) {
|
|
|
+ return savedPosition
|
|
|
+ } else {
|
|
|
+ return { top: 0 }
|
|
|
+ }
|
|
|
+ }
|
|
|
})
|
|
|
|
|
|
router.beforeEach((to, from, next) => {
|