vue路由---滚动行为

const router = new VueRouter({
     
  routes,
  mode: 'history',
  scrollBehavior (to, from, savedPosition) {
     
    if (savedPosition) {
     
      return savedPosition
    }else {
     
      return {
     x:0,y:0}
    }
  }
})

你可能感兴趣的:(vue,vue)