File tree Expand file tree Collapse file tree 3 files changed +7
-17
lines changed Expand file tree Collapse file tree 3 files changed +7
-17
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,8 @@ declare module 'path-to-regexp' {
5
5
}
6
6
}
7
7
8
+ declare var __VUE_SSR_CONTEXT__: any ;
9
+
8
10
declare type RouterOptions = {
9
11
routes ?: Array < RouteConfig > ;
10
12
mode ?: string ;
Original file line number Diff line number Diff line change 1
1
/* @flow */
2
+ /* globals __VUE_SSR_CONTEXT__ */
2
3
3
4
import type VueRouter from '../index'
4
5
import { History } from './base'
@@ -43,13 +44,10 @@ export class AbstractHistory extends History {
43
44
} )
44
45
}
45
46
46
- setInitialRoute ( route : Route ) {
47
- this . current = route
48
- this . stack = [ this . current ]
49
- this . index = 0
50
- }
51
-
52
47
getLocation ( ) {
53
- return '/'
48
+ return (
49
+ typeof __VUE_SSR_CONTEXT__ !== 'undefined' &&
50
+ __VUE_SSR_CONTEXT__ . url
51
+ ) || '/'
54
52
}
55
53
}
Original file line number Diff line number Diff line change @@ -98,16 +98,6 @@ export default class VueRouter {
98
98
this . go ( 1 )
99
99
}
100
100
101
- setInitialLocation ( location : RawLocation ) {
102
- const route = this . match ( location )
103
- if ( this . history instanceof AbstractHistory ) {
104
- this . history . setInitialRoute ( route )
105
- }
106
- if ( this . app ) {
107
- this . app . _route = route
108
- }
109
- }
110
-
111
101
getMatchedComponents ( ) : Array < any > {
112
102
if ( ! this . currentRoute ) {
113
103
return [ ]
You can’t perform that action at this time.
0 commit comments