[英]antd: Radio buttons as cards
我想創建具有單選按鈕功能的卡片,當單擊卡片時,它應該將其顯示為“已選擇”,並從先前選擇的卡片中刪除“選擇”。
知道怎么做嗎?
我正在使用 antd 組件。
在此先感謝您,如果您需要任何額外的代碼片段,請告訴我。
AntD Radio.Button 接受子元素,因此您可以嘗試給它一個 Card 組件。
我用自定義圖標做了類似的事情
<Radio.Group
size="large"
buttonStyle="solid"
className="large-icons"
>
<Radio.Button value="Canine">
<CustomIcon type="cute-dog" />
Canine
</Radio.Button>
<Radio.Button value="Feline">
<CustomIcon type="nice-cat" />
Feline
</Radio.Button>
</Radio.Group>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.