Skip to content

Commit

Permalink
fix(hash): hash routing crashes when url has querystring
Browse files Browse the repository at this point in the history
  • Loading branch information
QingWei-Li committed Jun 2, 2017
1 parent d286963 commit 6d48ce1
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/core/router/history/hash.js
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down

0 comments on commit 6d48ce1

Please sign in to comment.