docs: format api radio/rate/switch (#25342)

This commit is contained in:
xrkffgg 2020-07-01 16:21:56 +08:00 committed by GitHub
parent 0a80ca75ad
commit 58ede7df60
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 68 additions and 68 deletions

View File

@ -18,11 +18,11 @@ Radio.
| Property | Description | Type | Default |
| --- | --- | --- | --- |
| autoFocus | get focus when component mounted | boolean | false |
| checked | Specifies whether the radio is selected. | boolean | |
| defaultChecked | Specifies the initial state: whether or not the radio is selected. | boolean | false |
| autoFocus | Whether get focus when component mounted | boolean | false |
| checked | Specifies whether the radio is selected | boolean | false |
| defaultChecked | Specifies the initial state: whether or not the radio is selected | boolean | false |
| disabled | Disable radio | boolean | false |
| value | According to value for comparison, to determine whether the selected | any | |
| value | According to value for comparison, to determine whether the selected | any | - |
### RadioGroup
@ -30,15 +30,15 @@ Radio group can wrap a group of `Radio`。
| Property | Description | Type | Default | Version |
| --- | --- | --- | --- | --- |
| defaultValue | Default selected value | any | | |
| defaultValue | Default selected value | any | - | |
| disabled | Disable all radio buttons | boolean | false | |
| name | The `name` property of all `input[type="radio"]` children | string | | |
| options | set children optional | string\[] \| Array<{ label: string value: string disabled?: boolean }> | | |
| size | size for radio button style | `large` \| `middle` \| `small` | | |
| value | Used for setting the currently selected value. | any | | |
| onChange | The callback function that is triggered when the state changes. | Function(e:Event) | | |
| optionType | set Radio optionType | `default` \| `button` | `default` | 4.4.0 |
| buttonStyle | style type of radio button | `outline` \| `solid` | `outline` | |
| name | The `name` property of all `input[type="radio"]` children | string | - | |
| options | Set children optional | string\[] \| Array<{ label: string value: string disabled?: boolean }> | - | |
| size | The size of radio button style | `large` \| `middle` \| `small` | - | |
| value | Used for setting the currently selected value | any | - | |
| onChange | The callback function that is triggered when the state changes | function(e:Event) | - | |
| optionType | Set Radio optionType | `default` \| `button` | `default` | 4.4.0 |
| buttonStyle | The style type of radio button | `outline` \| `solid` | `outline` | |
## Methods
@ -46,5 +46,5 @@ Radio group can wrap a group of `Radio`。
| Name | Description |
| ------- | ------------ |
| blur() | remove focus |
| focus() | get focus |
| blur() | Remove focus |
| focus() | Get focus |

View File

@ -23,7 +23,7 @@ cover: https://gw.alipayobjects.com/zos/alicdn/8cYb5seNB/Radio.svg
| checked | 指定当前是否选中 | boolean | false |
| defaultChecked | 初始是否选中 | boolean | false |
| disabled | 禁用 Radio | boolean | false |
| value | 根据 value 进行比较,判断是否选中 | any | |
| value | 根据 value 进行比较,判断是否选中 | any | - |
### RadioGroup
@ -31,15 +31,15 @@ cover: https://gw.alipayobjects.com/zos/alicdn/8cYb5seNB/Radio.svg
| 参数 | 说明 | 类型 | 默认值 | 版本 |
| --- | --- | --- | --- | --- |
| defaultValue | 默认选中的值 | any | | |
| disabled | 禁选所有子单选器 | boolean | false | | |
| name | RadioGroup 下所有 `input[type="radio"]``name` 属性 | string | | |
| options | 以配置形式设置子元素 | string\[] \| Array<{ label: string value: string disabled?: boolean }> | | |
| size | 大小,只对按钮样式生效 | `large` \| `middle` \| `small` | - | |
| value | 用于设置当前选中的值 | any | | |
| onChange | 选项变化时的回调函数 | Function(e:Event) | | |
| defaultValue | 默认选中的值 | any | - | |
| disabled | 禁选所有子单选器 | boolean | false | | |
| name | RadioGroup 下所有 `input[type="radio"]``name` 属性 | string | - | |
| options | 以配置形式设置子元素 | string\[] \| Array<{ label: string value: string disabled?: boolean }> | - | |
| size | 大小,只对按钮样式生效 | `large` \| `middle` \| `small` | - | |
| value | 用于设置当前选中的值 | any | - | |
| onChange | 选项变化时的回调函数 | function(e:Event) | - | |
| optionType | 用于设置 Radio `options` 类型 | `default` \| `button` | `default` | 4.4.0 |
| buttonStyle | RadioButton 的风格样式,目前有描边和填色两种风格 | `outline` \| `solid` | `outline` | |
| buttonStyle | RadioButton 的风格样式,目前有描边和填色两种风格 | `outline` \| `solid` | `outline` | |
## 方法

View File

@ -16,26 +16,26 @@ Rate component.
| Property | Description | type | Default | Version |
| --- | --- | --- | --- | --- |
| allowClear | whether to allow clear when click again | boolean | true | |
| allowHalf | whether to allow semi selection | boolean | false | |
| autoFocus | get focus when component mounted | boolean | false | |
| character | custom character of rate | ReactNode \| (RateProps) => ReactNode | [`<StarFilled />`](/components/icon/) | Function(): 4.4.0 |
| className | custom class name of rate | string | | |
| count | star count | number | 5 | |
| defaultValue | default value | number | 0 | |
| disabled | read only, unable to interact | boolean | false | |
| style | custom style object of rate | CSSProperties | | |
| tooltips | Customize tooltip by each character | string\[] | | |
| value | current value | number | | |
| onBlur | callback when component lose focus | Function() | | |
| onChange | callback when select value | Function(value: number) | | |
| onFocus | callback when component get focus | Function() | | |
| onHoverChange | callback when hover item | Function(value: number) | | |
| onKeyDown | callback when keydown on component | Function(event) | | |
| allowClear | Whether to allow clear when click again | boolean | true | |
| allowHalf | Whether to allow semi selection | boolean | false | |
| autoFocus | If get focus when component mounted | boolean | false | |
| character | The custom character of rate | ReactNode \| (RateProps) => ReactNode | &lt;StarFilled /> | function(): 4.4.0 |
| className | The custom class name of rate | string | - | |
| count | Star count | number | 5 | |
| defaultValue | The default value | number | 0 | |
| disabled | If read only, unable to interact | boolean | false | |
| style | The custom style object of rate | CSSProperties | - | |
| tooltips | Customize tooltip by each character | string\[] | - | |
| value | The current value | number | - | |
| onBlur | Callback when component lose focus | function() | - | |
| onChange | Callback when select value | function(value: number) | - | |
| onFocus | Callback when component get focus | function() | - | |
| onHoverChange | Callback when hover item | function(value: number) | - | |
| onKeyDown | Callback when keydown on component | function(event) | - | |
## Methods
| Name | Description |
| ------- | ------------ |
| blur() | remove focus |
| focus() | get focus |
| blur() | Remove focus |
| focus() | Get focus |

View File

@ -20,19 +20,19 @@ cover: https://gw.alipayobjects.com/zos/alicdn/R5uiIWmxe/Rate.svg
| allowClear | 是否允许再次点击后清除 | boolean | true | |
| allowHalf | 是否允许半选 | boolean | false | |
| autoFocus | 自动获取焦点 | boolean | false | |
| character | 自定义字符 | ReactNode \| (RateProps) => ReactNode | [`<StarFilled />`](/components/icon/) | Function(): 4.4.0 |
| className | 自定义样式类名 | string | | |
| character | 自定义字符 | ReactNode \| (RateProps) => ReactNode | &lt;StarFilled /> | function(): 4.4.0 |
| className | 自定义样式类名 | string | - | |
| count | star 总数 | number | 5 | |
| defaultValue | 默认值 | number | 0 | |
| disabled | 只读,无法进行交互 | boolean | false | |
| style | 自定义样式对象 | CSSProperties | | |
| tooltips | 自定义每项的提示信息 | string\[] | | |
| value | 当前数,受控值 | number | | |
| onBlur | 失去焦点时的回调 | Function() | | |
| onChange | 选择时的回调 | Function(value: number) | | |
| onFocus | 获取焦点时的回调 | Function() | | |
| onHoverChange | 鼠标经过时数值变化的回调 | Function(value: number) | | |
| onKeyDown | 按键回调 | Function(event) | | |
| style | 自定义样式对象 | CSSProperties | - | |
| tooltips | 自定义每项的提示信息 | string\[] | - | |
| value | 当前数,受控值 | number | - | |
| onBlur | 失去焦点时的回调 | function() | - | |
| onChange | 选择时的回调 | function(value: number) | - | |
| onFocus | 获取焦点时的回调 | function() | - | |
| onHoverChange | 鼠标经过时数值变化的回调 | function(value: number) | - | |
| onKeyDown | 按键回调 | function(event) | - | |
## 方法

View File

@ -16,21 +16,21 @@ Switching Selector.
| Property | Description | Type | Default |
| --- | --- | --- | --- |
| autoFocus | get focus when component mounted | boolean | false |
| checked | determine whether the `Switch` is checked | boolean | false |
| checkedChildren | content to be shown when the state is checked | string\|ReactNode | |
| defaultChecked | to set the initial state | boolean | false |
| autoFocus | Whether get focus when component mounted | boolean | false |
| checked | Determine whether the Switch is checked | boolean | false |
| checkedChildren | The content to be shown when the state is checked | string \| ReactNode | - |
| defaultChecked | Whether to set the initial state | boolean | false |
| disabled | Disable switch | boolean | false |
| loading | loading state of switch | boolean | false |
| size | the size of the `Switch`, options: `default` `small` | string | `default` |
| unCheckedChildren | content to be shown when the state is unchecked | string\|ReactNode | |
| onChange | trigger when the checked state is changing | Function(checked: boolean, event: Event) | |
| onClick | trigger when clicked | Function(checked: boolean, event: Event) | |
| className | additional class to Switch | string | |
| loading | Loading state of switch | boolean | false |
| size | The size of the Switch, options: `default` `small` | string | `default` |
| unCheckedChildren | The content to be shown when the state is unchecked | string \| ReactNode | - |
| onChange | Trigger when the checked state is changing | function(checked: boolean, event: Event) | - |
| onClick | Trigger when clicked | function(checked: boolean, event: Event) | - |
| className | The additional class to Switch | string | - |
## Methods
| Name | Description |
| ------- | ------------ |
| blur() | remove focus |
| focus() | get focus |
| blur() | Remove focus |
| focus() | Get focus |

View File

@ -19,15 +19,15 @@ cover: https://gw.alipayobjects.com/zos/alicdn/zNdJQMhfm/Switch.svg
| --- | --- | --- | --- |
| autoFocus | 组件自动获取焦点 | boolean | false |
| checked | 指定当前是否选中 | boolean | false |
| checkedChildren | 选中时的内容 | string\|ReactNode | |
| checkedChildren | 选中时的内容 | string \| ReactNode | - |
| defaultChecked | 初始是否选中 | boolean | false |
| disabled | 是否禁用 | boolean | false |
| loading | 加载中的开关 | boolean | false |
| size | 开关大小,可选值:`default` `small` | string | `default` |
| unCheckedChildren | 非选中时的内容 | string\|ReactNode | |
| onChange | 变化时回调函数 | Function(checked: boolean, event: Event) | |
| onClick | 点击时回调函数 | Function(checked: boolean, event: Event) | |
| className | Switch 器类名 | string | |
| unCheckedChildren | 非选中时的内容 | string \| ReactNode | - |
| onChange | 变化时回调函数 | function(checked: boolean, event: Event) | - |
| onClick | 点击时回调函数 | function(checked: boolean, event: Event) | - |
| className | Switch 器类名 | string | - |
## 方法