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 {
8787
8888export function getLocation ( base : string ) : string {
8989 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 ) ) ) {
9197 path = path . slice ( base . length )
9298 }
9399 return ( path || '/' ) + window . location . search + window . location . hash
You can’t perform that action at this time.
0 commit comments