在main.js中加入全局后置钩子即可,代码如下: // 路由跳转自动跳转到顶部 router.afterEach((to, from, next) => { window.scrollTo(0, 0); })