feat: only start nprogress when to from different (#318)
This commit is contained in:
parent
f1af7424e2
commit
d0f6274ac4
@ -3,7 +3,10 @@ import type { UserModule } from '~/types'
|
|||||||
|
|
||||||
export const install: UserModule = ({ isClient, router }) => {
|
export const install: UserModule = ({ isClient, router }) => {
|
||||||
if (isClient) {
|
if (isClient) {
|
||||||
router.beforeEach(() => { NProgress.start() })
|
router.beforeEach((to, from) => {
|
||||||
|
if (to.path !== from.path)
|
||||||
|
NProgress.start()
|
||||||
|
})
|
||||||
router.afterEach(() => { NProgress.done() })
|
router.afterEach(() => { NProgress.done() })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user