ion-radio-group
单选按钮组是一组单选按钮的容器。它允许用户从一组中最多选择一个单选按钮。选中属于某个单选按钮组的一个单选按钮会取消选中同一组中先前选中的任何单选按钮。有关单选按钮组的示例用法,请参阅 radio 文档。
接口
RadioGroupChangeEventDetail
interface RadioGroupChangeEventDetail<T = any> {
value: T;
}
RadioGroupCustomEvent
虽然不是必需的,但此接口可以替代 CustomEvent 接口,为此组件 发出的 Ionic 事件提供更强的类型支持。
interface RadioGroupCustomEvent<T = any> extends CustomEvent {
detail: RadioGroupChangeEventDetail<T>;
target: HTMLIonRadioGroupElement;
}
属性
allowEmptySelection
| 说明 | If true, the radios can be deselected. |
| 属性 | allow-empty-selection |
| 类型 | boolean |
| 默认值 | false |
compareWith
| 说明 | This property allows developers to specify a custom function or property name for comparing objects when determining the selected option in the ion-radio-group. When not specified, the default behavior will use strict equality (===) for comparison. |
| 属性 | compare-with |
| 类型 | ((currentValue: any, compareValue: any) => boolean) | null | string | undefined |
| 默认值 | undefined |
errorText
| 说明 | The error text to display at the top of the radio group. |
| 属性 | error-text |
| 类型 | string | undefined |
| 默认值 | undefined |
helperText
| 说明 | The helper text to display at the top of the radio group. |
| 属性 | helper-text |
| 类型 | string | undefined |
| 默认值 | undefined |
name
| 说明 | The name of the control, which is submitted with the form data. |
| 属性 | name |
| 类型 | string |
| 默认值 | this.inputId |
value
| 说明 | the value of the radio group. |
| 属性 | value |
| 类型 | any |
| 默认值 | undefined |
事件
| Name | 说明 | 冒泡 |
|---|---|---|
ionChange | Emitted when the value has changed. This event will not emit when programmatically setting the value property. | true |
方法
该组件没有可用的公共方法。
CSS Shadow Parts
该组件没有可用的 CSS 阴影部分。
CSS 自定义属性
该组件没有可用的 CSS 自定义属性。
插槽
该组件没有可用的插槽。