react this.setState 存储对象
2020-01-17 本文已影响0人
逸笛
const { attributeValue = [] } = this.state;
this.setState({
attributeValue: [...attributeValue, { id, name }],
});
const { attributeValue = [] } = this.state;
this.setState({
attributeValue: [...attributeValue, { id, name }],
});