Skip to content
This repository has been archived by the owner on Apr 6, 2023. It is now read-only.

perf(nuxt): use simple JSON.stringify to compare params #8340

Merged
merged 1 commit into from
Oct 19, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 1 addition & 2 deletions packages/nuxt/src/pages/runtime/router.options.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import type { RouterConfig } from '@nuxt/schema'
import type { RouterScrollBehavior, RouteLocationNormalized } from 'vue-router'
import { isEqual } from 'ohash'
import { nextTick } from 'vue'
import { useNuxtApp } from '#app'

Expand Down Expand Up @@ -59,7 +58,7 @@ function _isDifferentRoute (a: RouteLocationNormalized, b: RouteLocationNormaliz
if (!samePageComponent) {
return true
}
if (samePageComponent && !isEqual(a.params, b.params)) {
if (samePageComponent && JSON.stringify(a.params) !== JSON.stringify(b.params)) {
return true
}
return false
Expand Down