ruoyi-plus-soybean/src/router/permission.ts
2021-08-18 12:02:59 +08:00

16 lines
327 B
TypeScript

import type { Router } from 'vue-router';
/**
* 路由守卫函数
* @param router - 路由实例
*/
export default function createRouterGuide(router: Router) {
router.beforeEach((to, from, next) => {
window.$loadingBar?.start();
next();
});
router.afterEach(() => {
window.$loadingBar?.finish();
});
}