- 切换路由时,路由的滚动条还是在底部
const router = new VueRouter({ routes, // 控制切换路由时滚动行为 scrollBehavior(to, from, savedPosition) { if (savedPosition) { return savedPosition; } else { return { x: 0, y: 0 }; } }, });
标签:return,savedPosition,切换,滚动,行为,路由 From: https://www.cnblogs.com/czwhandsome/p/16857678.html