Skip to content

Commit d6e80cb

Browse files
committed
revert scrollBehavior timing
1 parent a758035 commit d6e80cb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/history/html5.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ export class HTML5History extends History {
7979
assert(typeof behavior === 'function', `scrollBehavior must be a function`)
8080

8181
// wait until re-render finishes before scrolling
82-
setTimeout(() => {
82+
router.app.$nextTick(() => {
8383
let position = getScrollPosition(_key)
8484
const shouldScroll = behavior(to, from, isPop ? position : null)
8585
if (!shouldScroll) {
@@ -100,7 +100,7 @@ export class HTML5History extends History {
100100
if (position) {
101101
window.scrollTo(position.x, position.y)
102102
}
103-
}, 0)
103+
})
104104
}
105105
}
106106

0 commit comments

Comments
 (0)