我曾尝试在一个单选按钮click.How上的div(该值是从数组中获取的)中获取值,我可以获取该值吗?
fn(){
value
}
{id1 && id1.map(list =>
<div style={{padding:'6px 6px'}}>
{"ClaimID:"+ list.ID+' '+'-'+"PatientID:"+list.RCID+' '+'-'+' '+"Amount:" +new Intl.NumberFormat('en-USD', {currency: 'USD' ,style: 'currency'}).format(Number(list.Amount))}
<input type='radio' name={'PatientID: ' + list.RCID} vlaue={'PatientID: ' + list.RCID} style={{width: '50px'}} /> </div>)}

发布于 2019-06-07 14:09:55
虽然你的问题不清楚,但我认为你可以使用下面的代码:
state = {
selectedRadioValue: null
}
changeRadioButton = (e) => {
if(e.target.value == true){
this.setState({
selectedRadioValue : e.target.value
})
}
}
render() {
return(
<div>
<input type='radio' onChange= {(e) => {this.changeRadioButton(e)}}/>
<input type='radio' onChange= {(e) => {this.changeRadioButton(e)}}/>
</div>
)
}https://stackoverflow.com/questions/56488669
复制相似问题