mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-21 21:25:11 +00:00
chore: simplify conditional statements
This commit is contained in:
parent
d8d89b9dee
commit
df5038a272
@ -28,8 +28,7 @@ export default <RouterConfig> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Hash routes on the same page, no page hook is fired so resolve here
|
// Hash routes on the same page, no page hook is fired so resolve here
|
||||||
if (to.path === from.path) {
|
if (to.path === from.path && !to.hash) {
|
||||||
if (!to.hash) {
|
|
||||||
if (from.hash) {
|
if (from.hash) {
|
||||||
return { left: 0, top: 0 }
|
return { left: 0, top: 0 }
|
||||||
}
|
}
|
||||||
@ -37,7 +36,6 @@ export default <RouterConfig> {
|
|||||||
// The route isn't changing so keep current scroll position
|
// The route isn't changing so keep current scroll position
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// Wait for `page:transition:finish` or `page:finish` depending on if transitions are enabled or not
|
// Wait for `page:transition:finish` or `page:finish` depending on if transitions are enabled or not
|
||||||
const hasTransition = (route: RouteLocationNormalized) => !!(route.meta.pageTransition ?? defaultPageTransition)
|
const hasTransition = (route: RouteLocationNormalized) => !!(route.meta.pageTransition ?? defaultPageTransition)
|
||||||
|
Loading…
Reference in New Issue
Block a user