mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-26 07:32:01 +00:00
perf(nuxt): use simple JSON.stringify
to compare params (#8340)
This commit is contained in:
parent
9415f54a1a
commit
0f2ef5d412
@ -1,6 +1,5 @@
|
|||||||
import type { RouterConfig } from '@nuxt/schema'
|
import type { RouterConfig } from '@nuxt/schema'
|
||||||
import type { RouterScrollBehavior, RouteLocationNormalized } from 'vue-router'
|
import type { RouterScrollBehavior, RouteLocationNormalized } from 'vue-router'
|
||||||
import { isEqual } from 'ohash'
|
|
||||||
import { nextTick } from 'vue'
|
import { nextTick } from 'vue'
|
||||||
import { useNuxtApp } from '#app'
|
import { useNuxtApp } from '#app'
|
||||||
|
|
||||||
@ -59,7 +58,7 @@ function _isDifferentRoute (a: RouteLocationNormalized, b: RouteLocationNormaliz
|
|||||||
if (!samePageComponent) {
|
if (!samePageComponent) {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
if (samePageComponent && !isEqual(a.params, b.params)) {
|
if (samePageComponent && JSON.stringify(a.params) !== JSON.stringify(b.params)) {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
|
Loading…
Reference in New Issue
Block a user