摘要: <?php // 配置json header("Content-type: application/json;charset=UTF-8"); // 跨域配置 header("Access-Control-Allow-Credentials: true"); header("Access-Contr 阅读全文
posted @ 2020-12-09 21:24 公瑾当年 阅读(914) 评论(0) 推荐(0) 编辑
摘要: redux 中的 store 仅支持同步数据流。使用 thunk 等中间件可以帮助在 redux 中实现异步操作。 redux-thunk 使用流程 下载 redux-thunk npm install redux-thunk -S store 中引入 redux-thunk 中间件,并挂载 red 阅读全文
posted @ 2020-12-09 21:06 公瑾当年 阅读(199) 评论(0) 推荐(0) 编辑
摘要: 当业务应用变得复杂,我们就需要对 reducer 函数进行拆分,拆分后的每一块独立负责管理 state 的一部分。 combineReducers() 辅助函数的作用就是:把一个由多个不同 reducer 函数作为 value 的 object 合并成为一个总的 reducers 函数。然后可以对这 阅读全文
posted @ 2020-12-09 20:58 公瑾当年 阅读(5065) 评论(0) 推荐(3) 编辑