You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

15 lines
624 B

export default function(ctx){
//离开页面 刷新前 将store中的数据存到session 刷新找不到狀態樹,因爲屬順序問題
window.addEventListener('beforeunload', ()=> {
// sessionStorage.setItem("storeCache",JSON.stringify(ctx.store.state))
});
//页面加载完成 将session中的store数据
window.addEventListener('load', ()=> {
// let storeCache = sessionStorage.getItem("storeCache")
// if(storeCache){
// // 将session中的store数据替换到store中
// ctx.store.replaceState(JSON.parse(storeCache));
// }
});
}