dvajs / dva

🌱 React and redux based, lightweight and elm-style framework. (Inspired by elm and choo)
https://dvajs.com/
MIT License
16.24k stars 3.17k forks source link

页面刷新,状态丢失,怎么解决 #2432

Closed lhc0229 closed 2 years ago

lhc0229 commented 3 years ago

What happens?

最小可复现仓库

请使用 yarn create umi 创建,选择 app,然后选上 dva,并上传到你的 GitHub 仓库

复现步骤,错误日志以及相关配置

相关环境信息

Big-Devils commented 3 years ago

可以尝试放在session里

574495412 commented 3 years ago

这个库不是永久保存状态的

xiaoma-FrontEnd commented 2 years ago

我也碰到了,同样的问题,页面刷新,数据丢失,请问你是怎么解决的?

Big-Devils commented 2 years ago

我也碰到了,同样的问题,页面刷新,数据丢失,请问你是怎么解决的?

如果需要长久存储的数据比较少,可以在存储的时候在本地(storage)里存一份,如果比较多,可以使用一下长久存储的第三方库

fwh1990 commented 2 years ago

使用 redux-persist

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.