vitesse/src/modules/nprogress.ts
2021-02-05 09:34:09 +08:00

10 lines
259 B
TypeScript

import NProgress from 'nprogress'
import { UserModule } from '~/types'
export const install: UserModule = ({ isClient, router }) => {
if (isClient) {
router.beforeEach(() => { NProgress.start() })
router.afterEach(() => { NProgress.done() })
}
}