feat: only start nprogress when to from different (#318)
This commit is contained in:
1 file changed
+4
-1
@@ -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() })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user