mirror of
https://github.com/nuxt/nuxt.git
synced 2025-02-24 09:28:41 +00:00
refactor: use ternary
This commit is contained in:
parent
2480983b2a
commit
88dfbcba65
@ -63,13 +63,7 @@ function _getHashElementScrollMarginTop (selector: string): number {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function _isDifferentRoute (from: RouteLocationNormalized, to: RouteLocationNormalized): boolean {
|
function _isDifferentRoute (from: RouteLocationNormalized, to: RouteLocationNormalized): boolean {
|
||||||
const samePageComponent = to.path === from.path
|
const isSamePath = to.path === from.path
|
||||||
|
|
||||||
if (!samePageComponent) {
|
return isSamePath ? JSON.stringify(from.params) !== JSON.stringify(to.params) : true
|
||||||
return true
|
|
||||||
}
|
|
||||||
if (samePageComponent && JSON.stringify(from.params) !== JSON.stringify(to.params)) {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
return false
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user