1.合并對(duì)象 Object.assign(obj1,obj2)
//react修改state下的對(duì)象的某一屬性
let btnList = Object.assign(this.state.btnList, {
nowindex: fromChildIndex
})
this.setState({
btnList
})
1.合并對(duì)象 Object.assign(obj1,obj2)
//react修改state下的對(duì)象的某一屬性
let btnList = Object.assign(this.state.btnList, {
nowindex: fromChildIndex
})
this.setState({
btnList
})