在封装的router.js中加上改代码
const router = new Router({
routes: [....],
scrollBehavior (to, from, savedPosition) {
return { x: 0, y: 0 }
},
})
export default router
在封装的router.js中加上改代码
const router = new Router({
routes: [....],
scrollBehavior (to, from, savedPosition) {
return { x: 0, y: 0 }
},
})
export default router