13 lines
317 B
TypeScript
13 lines
317 B
TypeScript
import NProgress from 'nprogress'
|
|
import { type UserModule } from '~/types'
|
|
|
|
export const install: UserModule = ({ isClient, router }) => {
|
|
if (isClient) {
|
|
router.beforeEach((to, from) => {
|
|
if (to.path !== from.path)
|
|
NProgress.start()
|
|
})
|
|
router.afterEach(() => { NProgress.done() })
|
|
}
|
|
}
|