我得補充修改對象以uuid數組中的鍵
我有刪除
現在我需要修改
添加只是增加了一堆隨意
刪除是能夠做到這一點是外科醫生的精準度工作,因爲它使用了鍵查找它的罪魁禍首:
addInput = (name) => {
const newInputs = this.props.parameters;
newInputs.push({
name,
key: uuid(),
value: { input: '' },
icon: { inputIcon: 0 },
});
this.setState({
newInput: newInputs,
});
this.props.exportParameter(newInputs);
};
removeInput = (key) => {
const newInputs = this.props.parameters.filter(x => x.key !== key);
this.setState({
newInput: newInputs,
});
this.props.exportParameter(newInputs);
};
如何修改(例如,將值設回「」而不刪除並重新創建項目)?
modifyInput = (key) => {
?????
};
_「不刪除並重新創建項目)「_ – guest271314
是的。這既不 –