diff --git a/packages/nuxt/src/pages/runtime/router.options.ts b/packages/nuxt/src/pages/runtime/router.options.ts index 565bdd18f4..0fe3f4de76 100644 --- a/packages/nuxt/src/pages/runtime/router.options.ts +++ b/packages/nuxt/src/pages/runtime/router.options.ts @@ -64,11 +64,5 @@ function _getHashElementScrollMarginTop (selector: string): number { function _isDifferentRoute (from: RouteLocationNormalized, to: RouteLocationNormalized): boolean { const isSamePath = to.path === from.path - - if (!isSamePath) { - return true - } else if (JSON.stringify(from.params) !== JSON.stringify(to.params)) { - return true - } - return false + return !isSamePath || JSON.stringify(from.params) !== JSON.stringify(to.params) }