fix(hash): hash routing crashes when url has querystring
This commit is contained in:
parent
d286963da0
commit
6d48ce1266
1 changed files with 5 additions and 5 deletions
|
|
@ -58,17 +58,17 @@ export class HashHistory extends History {
|
|||
parse (path = location.href) {
|
||||
let query = ''
|
||||
|
||||
const hashIndex = path.indexOf('#')
|
||||
if (hashIndex) {
|
||||
path = path.slice(hashIndex + 1)
|
||||
}
|
||||
|
||||
const queryIndex = path.indexOf('?')
|
||||
if (queryIndex >= 0) {
|
||||
query = path.slice(queryIndex + 1)
|
||||
path = path.slice(0, queryIndex)
|
||||
}
|
||||
|
||||
const hashIndex = path.indexOf('#')
|
||||
if (hashIndex) {
|
||||
path = path.slice(hashIndex + 1)
|
||||
}
|
||||
|
||||
return {
|
||||
path,
|
||||
file: this.getFile(path),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue