解决 vue 中拖动时多个页面互相影响的问题 (使用前端路由,当切换到新路由时,想要页面滚到顶部)
在路由中,添加 scrollBehavior (to, from, savedPosition) {return { x: 0, y: 0 } }当切换到新路由时,想要页面滚到顶部
export default new Router({
routes: [ {
path: '/',
name: 'Home',
component: Home...
原创
2018-07-20 10:36:07 ·
1090 阅读 ·
0 评论