fix: 后退前进功能
This commit is contained in:
@@ -976,7 +976,7 @@ export function urlParamsHandler (url, oldParams, newParams, cleanOldParams) {
|
||||
}
|
||||
|
||||
export function overwriteUrl (url) {
|
||||
window.history.pushState('', '', url)
|
||||
window.history.replaceState('', '', url)
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1005,15 +1005,3 @@ export function colorGradientCalculation (startColor, endColor, values) {
|
||||
export function colorHexToRgbArr (hex) {
|
||||
return [1, 3, 5].map((h) => parseInt(hex.substring(h, h + 2), 16))
|
||||
}
|
||||
|
||||
export function setHistory (to) {
|
||||
const historyJson = sessionStorage.getItem(storageKey.history)
|
||||
const query = { ...to.query, t: new Date().getTime() }
|
||||
if (historyJson) {
|
||||
const history = JSON.parse(historyJson)
|
||||
history.history.push({ path: to.path, query: query })
|
||||
sessionStorage.setItem(storageKey.history, JSON.stringify(history))
|
||||
} else {
|
||||
sessionStorage.setItem(storageKey.history, JSON.stringify({ index: 0, history: [query] }))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user