8000 no need to decodeURI in history implemenations · vuejs/vue-router@5df14c6 · GitHub
[go: up one dir, main page]

Skip to content

Commit 5df14c6

Browse files
committed
no need to decodeURI in history implemenations
1 parent be368d8 commit 5df14c6

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/history/hash.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export default class HashHistory {
2727
const query = location.search && path.indexOf('?') > -1
2828
? '&' + location.search.slice(1)
2929
: location.search
30-
self.onChange(decodeURI(path.replace(/^#!?/, '') + query))
30+
self.onChange(path.replace(/^#!?/, '') + query)
3131
}
3232
window.addEventListener('hashchange', this.listener)
3333
this.listener()

src/history/html5.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export default class HTML5History {
2323

2424
start () {
2525
this.listener = (e) => {
26-
let url = decodeURI(location.pathname + location.search)
26+
let url = location.pathname + location.search
2727
if (this.root) {
2828
url = url.replace(this.rootRE, '')
2929
}

0 commit comments

Comments
 (0)
0