Skip to content

Commit 0fd6fbf

Browse files
committed
fix scroll behavior test compat for rc.7
1 parent 091d5d9 commit 0fd6fbf

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/history/html5.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,15 +52,15 @@ export class HTML5History extends History {
5252

5353
push (location: RawLocation) {
5454
const current = this.current
55-
super.transitionTo(location, route => {
55+
this.transitionTo(location, route => {
5656
pushState(cleanPath(this.base + route.fullPath))
5757
this.handleScroll(route, current, false)
5858
})
5959
}
6060

6161
replace (location: RawLocation) {
6262
const current = this.current
63-
super.transitionTo(location, route => {
63+
this.transitionTo(location, route => {
6464
replaceState(cleanPath(this.base + route.fullPath))
6565
this.handleScroll(route, current, false)
6666
})
@@ -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-
router.app.$nextTick(() => {
82+
setTimeout(() => {
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-
})
103+
}, 0)
104104
}
105105
}
106106

0 commit comments

Comments
 (0)