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

This commit is contained in:
pooya parsa 2022-10-19 17:31:05 +02:00 committed by GitHub
parent 9415f54a1a
commit 0f2ef5d412
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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'
@ -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