Skip to content

Commit 4b52b41

Browse files
committed
fix initial location handling in abstract mode
1 parent e1ba83e commit 4b52b41

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

src/history/abstract.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,8 @@ export class AbstractHistory extends History {
4848
this.stack = [this.current]
4949
this.index = 0
5050
}
51+
52+
getLocation () {
53+
return '/'
54+
}
5155
}

src/index.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,12 @@ export default class VueRouter {
9595
}
9696

9797
setInitialLocation (location: RawLocation) {
98+
const route = this.match(location)
9899
if (this.history instanceof AbstractHistory) {
99-
this.history.setInitialRoute(this.match(location))
100+
this.history.setInitialRoute(route)
101+
}
102+
if (this.app) {
103+
this.app._route = route
100104
}
101105
}
102106
}

0 commit comments

Comments
 (0)