router/index.js 中添加如下配置
const router = new VueRouter({
routes,
// 解决页面跳转保存滚动条位置问题
scrollBehavior(to, from, savedPosition) {
return { x: 0, y: 0 }
},
})
router/index.js 中添加如下配置
const router = new VueRouter({
routes,
// 解决页面跳转保存滚动条位置问题
scrollBehavior(to, from, savedPosition) {
return { x: 0, y: 0 }
},
})