router-link跳转回到页面顶部 router-link跳转到新页面只会停留在上一个页面的位置 在main.js中加入 router.afterEach((to, from, next) => { window.scrollTo(0, 0); }) 引用出处: https://blog.csdn.net/weixin_45536426/article/details/108360215