fix(nuxt): routerBehavior comparison for hash block (#8383)

This commit is contained in:
Christian Burkhart 2022-10-21 01:27:40 -07:00 committed by GitHub
parent 69a6a86d7c
commit a0a59e2157
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -21,7 +21,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) {
if (from.hash && !to.hash) { if (from.hash && !to.hash) {
return { left: 0, top: 0 } return { left: 0, top: 0 }
} }