Files
financial-admin/src/router/guard/progress.ts
2025-12-16 20:20:53 +07:00

12 lines
260 B
TypeScript

import type { Router } from 'vue-router';
export function createProgressGuard(router: Router) {
router.beforeEach((_to, _from, next) => {
window.NProgress?.start?.();
next();
});
router.afterEach(_to => {
window.NProgress?.done?.();
});
}