diff --git a/src/modules/nprogress.ts b/src/modules/nprogress.ts index 6d57f52..8e433b6 100644 --- a/src/modules/nprogress.ts +++ b/src/modules/nprogress.ts @@ -3,7 +3,10 @@ import type { UserModule } from '~/types' export const install: UserModule = ({ isClient, router }) => { if (isClient) { - router.beforeEach(() => { NProgress.start() }) + router.beforeEach((to, from) => { + if (to.path !== from.path) + NProgress.start() + }) router.afterEach(() => { NProgress.done() }) } }