代码如下:
const [ tablesFields, setTablesFields ] = useState([]);
return(
<Radio.Group defaultValue={item.Enable} buttonStyle="solid" onChange={(e) => setTableEnable(index,e.target.value)}>
<Radio.Button value="T">开启</Radio.Button>
<Radio.Button value="F">禁用</Radio.Button>
</Radio.Group>
);
数组如下:
如上图所示我的数组是多维的我想更改某个索引下的字段的值如何更改呢?
修改好数组再把整个更新后的数组传入
setTablesFields
函数