Skip to content

Commit 6d48ce1

Browse files
committed
fix(hash): hash routing crashes when url has querystring
1 parent d286963 commit 6d48ce1

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/core/router/history/hash.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -58,17 +58,17 @@ export class HashHistory extends History {
5858
parse (path = location.href) {
5959
let query = ''
6060

61+
const hashIndex = path.indexOf('#')
62+
if (hashIndex) {
63+
path = path.slice(hashIndex + 1)
64+
}
65+
6166
const queryIndex = path.indexOf('?')
6267
if (queryIndex >= 0) {
6368
query = path.slice(queryIndex + 1)
6469
path = path.slice(0, queryIndex)
6570
}
6671

67-
const hashIndex = path.indexOf('#')
68-
if (hashIndex) {
69-
path = path.slice(hashIndex + 1)
70-
}
71-
7272
return {
7373
path,
7474
file: this.getFile(path),

0 commit comments

Comments
 (0)