zhang
2024-04-22 9c027fdcf5be48892fcc6e5e1ce8b78e3df4eb9c
src/router/guard/index.ts
@@ -6,6 +6,7 @@
import { Modal, notification } from 'ant-design-vue';
import { warn } from '@/utils/log';
import { unref } from 'vue';
import { prefixCls } from '@/settings/designSetting';
import { setRouteChange } from '@/logics/mitt/routeChange';
import { createPermissionGuard } from './permissionGuard';
import { createStateGuard } from './stateGuard';
@@ -104,7 +105,7 @@
  router.afterEach(async (to) => {
    // scroll top
    isHash((to as RouteLocationNormalized & { href: string })?.href) &&
      document.querySelector('.vben-layout-content')?.scrollTo(0, 0);
      document.querySelector(`.${prefixCls}-layout-content`)?.scrollTo(0, 0);
    return true;
  });
}