• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
IT-nose
博客园    首页    新随笔    联系   管理    订阅  订阅

react-redux 使用后台数据初始化(渲染)界面

注:首先在redux中改变state只能通过action操作,reducers改变state

在组件中

store.js

import { createStore } from "redux";
import rootReducer from './reducers/index';

let store = createStore(rootReducer);

export default store;

  
reducers.js中更新state为后台获取的数据

actions.js中声明操作行为

 

 详细代码百度云:https://pan.baidu.com/s/1E8ZYh8vxXWDjMGIz0s6Uvw

提取码:ug5e

posted @ 2018-07-18 17:20  detanx_墨鼬漓  阅读(2814)  评论(0)    收藏  举报
刷新页面返回顶部
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3