一、将数据放在本地缓存:
window.sessionStorage.setItem("tempList", JSON.stringify(res.result));
router.push(url)
二、并取出、删除操作:
//取出
const tempList: any = ref({})
tempList.value = window.sessionStorage.getItem('tempList')
三、以及监听用户刷新操作,在刷新之前删除缓存的数据:
```html
window.addEventListener("beforeunload", function (e) {
tempList.value = {}
window.sessionStorage.removeItem('tempList')
console.log('删除缓存数据:', tempList.value)
});