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.Group value 參數與 Radio.Button value 參數一致 可以回顯選中的的數據
Radio.Button 點擊事件Click
function handleClick(data) {
setDataName(data);
setVote({
...(vote ? vote : {}),
msg: data.de768,
});
}