We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
base
1 parent 52f4a9a commit f5db5b8Copy full SHA for f5db5b8
src/history/html5.js
@@ -62,6 +62,16 @@ export class HTML5History extends History {
62
63
export function getLocation (base: string): string {
64
let path = window.location.pathname
65
+
66
+ // Special handling for cases where base contains hash ('#')
67
+ if (base && base.indexOf('#') > -1) {
68
+ path = window.location.href.replace(window.location.origin, '')
69
+ if (path.indexOf(base) === 0) {
70
+ // Leave the rest of the url as-is
71
+ return (path.slice(base.length) || '/')
72
+ }
73
74
75
if (base && path.indexOf(base) === 0) {
76
path = path.slice(base.length)
77
}
0 commit comments