diff --git a/src/core/router/history/hash.js b/src/core/router/history/hash.js index 73b54ef3b..6a2dea9eb 100644 --- a/src/core/router/history/hash.js +++ b/src/core/router/history/hash.js @@ -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),