mirror of
https://github.com/fmhy/edit.git
synced 2026-01-31 00:01:11 +11:00
style: format with new style
This commit is contained in:
parent
bc3bbaafeb
commit
ef422dcda8
43 changed files with 686 additions and 583 deletions
|
|
@ -1,23 +1,23 @@
|
|||
import nprogress, { type NProgress } from "nprogress";
|
||||
import type { EnhanceAppContext } from "vitepress";
|
||||
import nprogress, { type NProgress } from 'nprogress'
|
||||
import type { EnhanceAppContext } from 'vitepress'
|
||||
|
||||
export function loadProgress(router: EnhanceAppContext["router"]): NProgress {
|
||||
if (typeof window === "undefined") return;
|
||||
export function loadProgress(router: EnhanceAppContext['router']): NProgress {
|
||||
if (typeof window === 'undefined') return
|
||||
|
||||
setTimeout(() => {
|
||||
nprogress.configure({ showSpinner: false });
|
||||
nprogress.configure({ showSpinner: false })
|
||||
|
||||
const cacheBeforeRouteChange = router.onBeforeRouteChange;
|
||||
const cacheAfterRouteChange = router.onAfterRouteChanged;
|
||||
const cacheBeforeRouteChange = router.onBeforeRouteChange
|
||||
const cacheAfterRouteChange = router.onAfterRouteChanged
|
||||
router.onBeforeRouteChange = (to) => {
|
||||
nprogress.start();
|
||||
cacheBeforeRouteChange?.(to);
|
||||
};
|
||||
nprogress.start()
|
||||
cacheBeforeRouteChange?.(to)
|
||||
}
|
||||
router.onAfterRouteChanged = (to) => {
|
||||
nprogress.done();
|
||||
cacheAfterRouteChange?.(to);
|
||||
};
|
||||
});
|
||||
nprogress.done()
|
||||
cacheAfterRouteChange?.(to)
|
||||
}
|
||||
})
|
||||
|
||||
return nprogress;
|
||||
return nprogress
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue