@yanhao98/vue-router-helper
All checks were successful
CI / cache-and-install (push) Successful in 59s

This commit is contained in:
严浩
2024-08-11 20:47:21 +08:00
parent 1b951af395
commit a4ea4e509f
4 changed files with 235 additions and 237 deletions

View File

@ -1,6 +1,6 @@
import NProgress from 'nprogress';
import { createLogGuard, createProgressGuard } from '@yanhao98/vue-router-helper';
import type { Router } from 'vue-router';
import { createLogGuard, createStackGuard } from './log-guard';
import { createStackGuard } from './stack-guard';
// Don't change the order of creation
export function setupRouterGuard(router: Router) {
@ -14,13 +14,3 @@ export function setupRouterGuard(router: Router) {
console.debug('🚨 [router error]: ', error);
});
}
export function createProgressGuard(router: Router) {
router.beforeEach(() => {
NProgress.start();
});
router.afterEach(() => {
NProgress.done();
});
}