web/src/router/guards/guard-nprogress.ts

16 lines
339 B
TypeScript

import { NProgress } from "@/libs/nprogress";
import { NavigationGuardWithThis, NavigationHookAfter } from "vue-router";
const before: NavigationGuardWithThis<undefined> = function () {
NProgress.start();
};
const after: NavigationHookAfter = function () {
NProgress.done();
};
export const nprogressGuard = {
before,
after,
};