react antd Radio单选框选中提交后刷新页面回显
作者:互联网
Radio渲染数据
<Radio.Group className={styles.content} value={vote.msg}> {data.judgeVoteList && data.judgeVoteList.map((item) => { return ( <Col span={5} offset={3} style={{ paddingTop: '28px' }}> <Radio.Button // disabled={vote.code === 2} value={item.de768} className={styles.btnInfo} onClick={() => handleClick(item)} > <div className={styles.btnInfoDiv}> <img src={man} /> <p className={styles.infoName}>{item.de281}</p> </div>
// 返回人员加上提示标签 {vote.msg === item.de281 && ( <NewEnergyIcon style={{ position: 'absolute', top: -10, left: 140, }} /> )} </Radio.Button>
Radio.Button 点击事件Click
function handleClick(data) { setDataName(data); setVote({ ...(vote ? vote : {}), msg: data.de768, }); }
标签:回显,单选框,handleClick,react,item,Radio,vote,data,msg 来源: https://www.cnblogs.com/zz19998/p/15075926.html