我想将复选框输入设置为检查特定输入是否用值填充但可以更改复选框值的选项。
autoAddFinalEvaluation = () => {
const {channelValue, evaluationValue, txtValue} = this.state;
if(channelValue !== null && evaluationValue !== null && txtValue !== '') {
this.setState({
checked: true
})
}
}
我认为问题是您取消选中复选框后执行了“ autoAddFinalEvaluation”,而仅当在我们称为父字段的输入中发生更改时才应调用它(输入的字段会导致选中复选框)。