File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -87,7 +87,13 @@ export class HTML5History extends History {
87
87
88
88
export function getLocation ( base : string ) : string {
89
89
let path = window . location . pathname
90
- if ( base && path . toLowerCase ( ) . indexOf ( base . toLowerCase ( ) ) === 0 ) {
90
+ const pathLowerCase = path . toLowerCase ( )
91
+ const baseLowerCase = base . toLowerCase ( )
92
+ // base="/a" shouldn't turn path="/app" into "/a/pp"
93
+ // https://github.com/vuejs/vue-router/issues/3555
94
+ // so we ensure the trailing slash in the base
95
+ if ( base && ( ( pathLowerCase === baseLowerCase ) ||
96
+ ( pathLowerCase . indexOf ( cleanPath ( baseLowerCase + '/' ) ) === 0 ) ) ) {
91
97
path = path . slice ( base . length )
92
98
}
93
99
return ( path || '/' ) + window . location . search + window . location . hash
You can’t perform that action at this time.
0 commit comments