export default new Router({
mode: 'history',
scrollBehavior (to, from, savedPosition) {
if (savedPosition) {
return savedPosition
} else {
return { x: 0, y: 0 }
}
},
...
})
export default new Router({
mode: 'history',
scrollBehavior (to, from, savedPosition) {
if (savedPosition) {
return savedPosition
} else {
return { x: 0, y: 0 }
}
},
...
})
本文标题:解决vue路由跳转页面,滚动条默认在页面底部的问题
本文链接:https://www.haomeiwen.com/subject/jtykactx.html
网友评论