![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
redux
葡萄葡萄豆干
这个作者很懒,什么都没留下…
展开
-
react动态改变样式的一种写法
(1)field-item是初始的样式;field-item.current-field为改变后对样式,即去掉下划线。 (2)从props中解构出state (3)然后根据解构出来的值灵活改变样式原创 2022-03-14 17:32:31 · 1640 阅读 · 1 评论 -
react中写switch语句
在周期中使用switch-case setLine(state, action) { switch (action.payload) { case action.payload.id === 'one': return ({ ...state, lineOne: { line_bar_X: action.payload.legendDataTwo, line_bar_Data: action.原创 2021-11-26 15:12:46 · 767 阅读 · 1 评论 -
redux中间件redux-thunk
作用 redux的dispatch默认只能传入一个对象参数: // 获取动态数据 export const getListAction = (data) => ({ type: GET_LIST, data, }) redux-thunk的作用是使dispatch支持函数参数: componentDidMount() { store.dispatch(getTodoList()) } redux-thunk的安装和配置 安装 yarn add redu原创 2021-09-17 11:09:40 · 143 阅读 · 0 评论