Skip to content
数据录入与表单

NnRadioGroup 单选框组

管理普通或按钮式单选状态。

示例

API

Props

名称类型默认值说明
valuestring | number | boolean''当前值,配合 v-model:value
disabledbooleanfalse禁用全部选项。
sizestring'default'small 使用小尺寸,其余为默认尺寸。
buttonStylestring'outline'solid 为实色按钮式外观,其余为轮廓外观。
optionTypestring'default'button 时由 options 生成 NnRadioButton,否则生成 NnRadio
optionsRadioOption[] | Primitive[][]非空时优先于默认插槽。原始值同时作为 labelvalue
ts
interface RadioOption {
    label: unknown;
    value: string | number | boolean;
    disabled?: boolean;
}

Events

事件参数说明
update:value(value)选择不同且可用的选项时触发。
change({ target: { value } })组级变更载荷。

Slots

名称作用域参数说明
defaultoptions 为空时放置 NnRadioNnRadioButton

Released under the MIT License.