Skip to content

FxRadio 单选框 / FxRadioGroup / FxRadioBtn ​

不依赖任何 UI 框架。

基础用法 ​

单选框组 ​

禁用(disabled) ​

disabled 属性禁用单选框。

按钮样式 ​

fill / text-color 自定义激活色。

v-for 渲染选项 ​

数据驱动(options) ​

传入 options 与 option-props 即可自动渲染,type="button" 切换按钮形态。options 数组项除 label / value / disabled(字段名可由 option-props 重命名)外的其余字段会透传给子 FxRadio / FxRadioBtn,可作为额外属性(如 id、data-*)下发。

边框(border) ​

尺寸(size) ​

FxRadio Props ​

属性类型默认值说明
model-value (v-model)string | number | boolean—绑定值
valuestring | number | boolean—radio 的值
labelstring | number | boolean—标签(value 缺省时兼作值)
size'large' | 'default' | 'small''default'尺寸
disabledbooleanfalse是否禁用
borderbooleanfalse是否显示边框
namestring—原生 name
aria-labelstring—aria-label

FxRadio Events ​

事件名说明
update:modelValue值变化
change变化时

FxRadio Slots ​

插槽名说明
default标签内容

FxRadioGroup Props ​

属性类型默认值说明
model-value (v-model)string | number | boolean—绑定值
size'large' | 'default' | 'small'—尺寸
disabledbooleanfalse禁用
fillstring''按钮激活填充色(仅 button 模式)
text-colorstring''按钮激活文字色(仅 button 模式)
namestring—原生 name
aria-labelstring—aria-label
validate-eventbooleantrue值变化时是否触发表单项校验
optionsArray<Record<string, any>>—选项数据,传入后无需手写子组件
option-props{ label?, value?, disabled? }—options 的字段别名配置
type'radio' | 'button''radio'形态:普通单选 / 按钮形态

FxRadioBtn Props ​

同 FxRadio(无 border)。