We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a758035 commit d6e80cbCopy full SHA for d6e80cb
src/history/html5.js
@@ -79,7 +79,7 @@ export class HTML5History extends History {
79
assert(typeof behavior === 'function', `scrollBehavior must be a function`)
80
81
// wait until re-render finishes before scrolling
82
- setTimeout(() => {
+ router.app.$nextTick(() => {
83
let position = getScrollPosition(_key)
84
const shouldScroll = behavior(to, from, isPop ? position : null)
85
if (!shouldScroll) {
@@ -100,7 +100,7 @@ export class HTML5History extends History {
100
if (position) {
101
window.scrollTo(position.x, position.y)
102
}
103
- }, 0)
+ })
104
105
106
0 commit comments