vuex技术刷新丢失原因
原创在app.vue里面加上
/*vuex数据刷新丢失问题*/
created() {
if (sessionStorage.getItem("store")) {
this.$store.replaceState(Object.assign({}, this.$store.state, JSON.parse(sessionStorage.getItem("store"))))
}
window.addEventListener("beforeunload", () => {
sessionStorage.setItem("store", JSON.stringify(this.$store.state))
});
},
版权声明
所有资源都来源于爬虫采集,如有侵权请联系我们,我们将立即删除