Skip to content

Commit a52287e

Browse files
committed
refactor
1 parent 5ca9883 commit a52287e

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/history/hash.js

+2-4
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,6 @@ function pushHash (path) {
9292
function replaceHash (path) {
9393
const href = window.location.href
9494
const i = href.indexOf('#')
95-
96-
window.location.replace(
97-
window.location.href.slice(0, i >= 0 ? i : href.length) + '#' + path
98-
)
95+
const base = i >= 0 ? href.slice(0, i) : href
96+
window.location.replace(`${base}#${path}`)
9997
}

0 commit comments

Comments
 (0)