无线电卡 
无线电卡输入字段
安装
yarn add @berlitz/radio-card
道具
| 参数 | 类型 | 需求 | 页:1 |
|---|---|---|---|
| 名称 | 字符串 | ✅ | 用于 name 字段的属性 |
| 数据 | 数组 | ✅ | 用于创建无线电卡的一串对象 |
| 价值 | 字符串、 数字、 布尔 | ❌ | 选中的当前值 |
| 变化 | 乐趣c | ❌ | 回调函数在更改时返回所选值 |
使用量
yarn add @berlitz/radio-card
import RadioCard from '@berlitz/radio-card'
const data = [
{
id: 'value-1',
title: `I'm the first`,
subtitle: `First subtitle`,
},
{
id: 'value-2',
title: `I'm the second`,
subtitle: `Second subtitle`,
disabled: true,
},
{
id: 'value-3',
title: `I'm the third`,
subtitle: `Third subtitle`,
disabled: true,
},
]
<RadioCard name='my_radio-card_field' data={data} value={selectedValue} onChange={value => setSelectedValue(value)} />
何时使用此组件
需要无线电按钮的任何输入字段