@yanhao98/vue-router-helper
All checks were successful
CI / cache-and-install (push) Successful in 59s
All checks were successful
CI / cache-and-install (push) Successful in 59s
This commit is contained in:
@ -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();
|
||||
});
|
||||
}
|
||||
|
Reference in New Issue
Block a user