We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 56f750b commit 11dd184Copy full SHA for 11dd184
src/history/html5.js
@@ -87,7 +87,13 @@ export class HTML5History extends History {
87
88
export function getLocation (base: string): string {
89
let path = window.location.pathname
90
- if (base && path.toLowerCase().indexOf(base.toLowerCase()) === 0) {
+ 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))) {
97
path = path.slice(base.length)
98
}
99
return (path || '/') + window.location.search + window.location.hash
0 commit comments