diff --git a/packages/nuxt/src/pages/runtime/router.options.ts b/packages/nuxt/src/pages/runtime/router.options.ts index 0551ee04b4..c8d58b7daf 100644 --- a/packages/nuxt/src/pages/runtime/router.options.ts +++ b/packages/nuxt/src/pages/runtime/router.options.ts @@ -65,5 +65,11 @@ function _getHashElementScrollMarginTop (selector: string): number { function _isDifferentRoute (from: RouteLocationNormalized, to: RouteLocationNormalized): boolean { const isSamePath = to.path === from.path - return isSamePath ? JSON.stringify(from.params) !== JSON.stringify(to.params) : true + if (!isSamePath) { + return true + } + if (isSamePath && JSON.stringify(from.params) !== JSON.stringify(to.params)) { + return true + } + return false }