Explorar el Código

路由跳转新页面后回到新页面顶部

reghao hace 3 años
padre
commit
3976fb76f6
Se han modificado 1 ficheros con 4 adiciones y 0 borrados
  1. 4 0
      src/router/index.js

+ 4 - 0
src/router/index.js

@@ -446,4 +446,8 @@ router.beforeEach((to, from, next) => {
   }
 })
 
+router.afterEach((to, from, next) => {
+  window.scrollTo(0, 0)
+})
+
 export default router