Skip to content

Commit afd230f

Browse files
billouboqyyx990803
authored andcommitted
fix bug beforeEnter fire twice on root path ('/') after async call (#735)
1 parent 2dde5bb commit afd230f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/history/hash.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ export class HashHistory extends History {
1515
}
1616

1717
ensureSlash()
18-
this.transitionTo(getHash())
19-
20-
window.addEventListener('hashchange', () => {
21-
this.onHashChange()
18+
this.transitionTo(getHash(), () => {
19+
window.addEventListener('hashchange', () => {
20+
this.onHashChange()
21+
})
2222
})
2323
}
2424

0 commit comments

Comments
 (0)