Browse Source

fix: 文档路由跳转后scrollTop的问题 (#386)

ghostchan 4 years ago
parent
commit
454af5ab36
1 changed files with 1 additions and 0 deletions
  1. 1 0
      src/sites/doc/router.ts

+ 1 - 0
src/sites/doc/router.ts

@@ -92,6 +92,7 @@ const router = createRouter({
   }
 });
 router.afterEach((to, from) => {
+  window.scrollTo(0, 0);
   new HttpClient().request('/user/saveVisitInfo', 'post', {
     headers: '',
     componentName: to.path.split('/')[1]