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

Commit

Permalink
perf(nuxt): use simple JSON.stringify to compare params (#8340)
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed Oct 19, 2022
1 parent 9415f54 commit 0f2ef5d
Showing 1 changed file with 1 addition and 2 deletions.
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

0 comments on commit 0f2ef5d

Please sign in to comment.