单选列表
对齐目标:@astryxdesign/core v0.7.1 · RadioList
RadioList 属性 #
| 名称 | 类型 | 默认值 | 说明 |
|---|---|---|---|
v-model | string | number | — | 必填。当前选中的值。 |
label | string | — | 必填。这一组的无障碍名称。 |
options | RadioOption[] | — | 纯文本选项。行尾需要内容时改用子项。 |
orientation | 'vertical' | 'horizontal' | 'vertical' | 纵向排列,或排成一行。 |
size | 'sm' | 'md' | 'md' | 指示器尺寸,20px 或 24px。单独的 Radio 仍是 18px。 |
description | string | — | 组标签下的说明。 |
status | FieldStatusInput | — | 错误、警告或成功。 |
statusVariant | 'attached' | 'detached' | 'tooltip' | 'detached' | 状态消息的位置。 |
isDisabled | boolean | false | 禁用整组。 |
disabledMessage | string | — | 整组被禁用的原因。和 isDisabled 一起用时,悬停或键盘聚焦会显示这段提示,每个选项仍可聚焦(带 aria-disabled),但选不中。 |
isRequired | boolean | false | 标记为必填。 |
containerClass | string | — | 加到字段外壳上的 class。横向标签的表单里没有外壳,这时不生效。 |
containerStyle | StyleValue | — | 加到字段外壳上的行内样式。 |
controlClass | string | — | 加到单选组(role="radiogroup")上的 class。 |
controlStyle | StyleValue | — | 加到单选组上的行内样式。 |
RadioListItem 属性 #
| 名称 | 类型 | 默认值 | 说明 |
|---|---|---|---|
value | string | number | — | 必填。选中后提交的值。 |
label | string | — | 必填。行标题。需要链接等富内容时用 label 插槽,点链接不会选中这一行。 |
description | string | — | 标题下的说明。富内容用 description 插槽。 |
isDisabled | boolean | false | 禁用这一行。 |
end 插槽画在标题后面。纵向列表里它靠行的尾端对齐。