mirror of
https://github.com/nuxt/nuxt.git
synced 2025-02-23 17:10:07 +00:00
chore: improve condition
This commit is contained in:
parent
96c6c9269c
commit
26898c6e26
@ -64,11 +64,5 @@ function _getHashElementScrollMarginTop (selector: string): number {
|
|||||||
|
|
||||||
function _isDifferentRoute (from: RouteLocationNormalized, to: RouteLocationNormalized): boolean {
|
function _isDifferentRoute (from: RouteLocationNormalized, to: RouteLocationNormalized): boolean {
|
||||||
const isSamePath = to.path === from.path
|
const isSamePath = to.path === from.path
|
||||||
|
return !isSamePath || JSON.stringify(from.params) !== JSON.stringify(to.params)
|
||||||
if (!isSamePath) {
|
|
||||||
return true
|
|
||||||
} else if (JSON.stringify(from.params) !== JSON.stringify(to.params)) {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
return false
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user