1.我们需要使用store进行数据管理,首先我们需要在detail目录下新建四个文件,actionCreatores,actionTypes,index,reducer
2.index.js文件中:引入actionCreators和actionTypes并且将其导出
import * as actionCreators from './actionCreators';
import * as actionTypes from './actionTypes';
export { actionCreators,actionTypes };
3.在redcuer中,我们定义一些数据
import { fromJS } from 'immutable';
import * as actionTypes from './actionTypes';
const defaultState = fromJS({
title: '一树花开',
content:<p>花色太过浓郁<br /><br />我惹了一身的花香<br /><br />是怪风多情<br /><br />还是我的途径</p><p>夏天的蝉<br /><br />吵醒了我的梦<br /><br />我以为冰激凌<br /><br />快化了<br /><br />谁知早就被猫<br /><br />吃了个精光</p>'
})
export default (state = defaultState, action) => {
switch (action.type) {
default: