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' {
55 }
66}
77
8+ declare var __VUE_SSR_CONTEXT__: any ;
9+
810declare type RouterOptions = {
911 routes ?: Array < RouteConfig > ;
1012 mode ?: string ;
Original file line number Diff line number Diff line change 11/* @flow */
2+ /* globals __VUE_SSR_CONTEXT__ */
23
34import type VueRouter from '../index'
45import { History } from './base'
@@ -43,13 +44,10 @@ export class AbstractHistory extends History {
4344 } )
4445 }
4546
46- setInitialRoute ( route : Route ) {
47- this . current = route
48- this . stack = [ this . current ]
49- this . index = 0
50- }
51-
5247 getLocation ( ) {
53- return '/'
48+ return (
49+ typeof __VUE_SSR_CONTEXT__ !== 'undefined' &&
50+ __VUE_SSR_CONTEXT__ . url
51+ ) || '/'
5452 }
5553}
Original file line number Diff line number Diff line change @@ -98,16 +98,6 @@ export default class VueRouter {
9898 this . go ( 1 )
9999 }
100100
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-
111101 getMatchedComponents ( ) : Array < any > {
112102 if ( ! this . currentRoute ) {
113103 return [ ]
You can’t perform that action at this time.
0 commit comments