router.beforeEach((to, from, next) => { //拦截指定路由 if(to.path === '/home'){ //todo }else{ scrollTo(0, 0); next(); } })