mirror of
https://github.com/soybeanjs/soybean-admin.git
synced 2025-11-14 20:53:41 +08:00
12 lines
260 B
TypeScript
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?.();
|
|
});
|
|
}
|