react-persist 数据持久化
一、下载安装npm i redux-persist二、新建一个仓库store文件夹,引入到其主文件index.jsimport {persistStore, persistReducer} from 'redux-persist'import localStorage from 'redux-persist/lib/storage'三、设置configconst config = { key: 'root', storage: localStorage, //这里是你要存
原创
2021-08-01 15:30:20 ·
373 阅读 ·
0 评论