let temp = [...this.state.tbdataSource];
temp.map(((item,key)=>{
if(key==index){
item[Name]=value;
}
}))
//此处使用JSON转换将数组对象让setState识别,不然界面不会更新
let temp2=JSON.stringify(temp);
let temp3=JSON.parse(temp2);
this.setState({
tbdataSource:temp3
})
其中数组对象数据如下
[{
Name:"",
DisplayName:"",
DataType:0,
Description:"",
DefaultValue:""
},{
Name:"",
DisplayName:"",
DataType:0,
Description:"",
DefaultValue:""
},{
Name:"",
DisplayName:"",
DataType:0,
Description:"",
DefaultValue:""
},{
Name:"",
DisplayName:"",
DataType:0,
Description:"",
DefaultValue:""
}]