您好,欢迎来到爱玩科技网。
搜索
您的当前位置:首页react 修改state某一属性值

react 修改state某一属性值

来源:爱玩科技网

1.state

// 筛选框相关数据
            searchSelect: { term: { value: '学期', key: '', options: [] }, type_of_personnel: { value: '教师类型', key: '', options: [] }, business_type: { value: '业务类型', key: '', options: [] },cycle_year: { value: '年', key: '', options: [] },cycle_month: { value: '月', key: '', options: [] } },

2.修改state

            let cycle_month = Object.assign({}, this.state.searchSelect.cycle_month, { key: dateString.split('-')[0] })
            let cycle_year = Object.assign({}, this.state.searchSelect.cycle_year, { key: dateString.split('-')[1] })
            let searchSelect = Object.assign({}, this.state.searchSelect, { cycle_month:cycle_month , cycle_year :cycle_year })

 

转载于:https://www.cnblogs.com/thinkingthigh/p/9909600.html

因篇幅问题不能全部显示,请点此查看更多更全内容

Copyright © 2019- aiwanbo.com 版权所有 赣ICP备2024042808号-3

违法及侵权请联系:TEL:199 18 7713 E-MAIL:2724546146@qq.com

本站由北京市万商天勤律师事务所王兴未律师提供法律服务