We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f223b25 commit 05a4c00Copy full SHA for 05a4c00
src/history/hash.js
@@ -21,10 +21,13 @@ export default class HashHistory {
21
location.replace(formattedPath)
22
return
23
}
24
- let pathToMatch = decodeURI(
25
- path.replace(/^#!?/, '') + location.search
26
- )
27
- self.onChange(pathToMatch)
+ // determine query
+ // note it's possible to have queries in both the actual URL
+ // and the hash fragment itself.
+ let query = location.search && path.indexOf('?') > -1
28
+ ? '&' + location.search.slice(1)
29
+ : location.search
30
+ self.onChange(decodeURI(path.replace(/^#!?/, '') + query))
31
32
window.addEventListener('hashchange', this.listener)
33
this.listener()
0 commit comments