mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-27 20:49:53 +08:00
docs: show version Number features were added (#17373)
* docs: add api first appearance * docs: fix auto-complete doc * docs: replace Version Added with Version * docs: date picker common method * docs: date picker common method * docs: tree * docs: remove meaningless 3.0.0
This commit is contained in:
parent
79bff3ff61
commit
fb0b4f0fc9
@ -14,12 +14,12 @@ Please note that Affix should not cover other content on the page, especially wh
|
|||||||
|
|
||||||
## API
|
## API
|
||||||
|
|
||||||
| Property | Description | Type | Default |
|
| Property | Description | Type | Default | Version |
|
||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- | --- |
|
||||||
| offsetBottom | Pixels to offset from bottom when calculating position of scroll | number | - |
|
| offsetBottom | Pixels to offset from bottom when calculating position of scroll | number | - | |
|
||||||
| offsetTop | Pixels to offset from top when calculating position of scroll | number | 0 |
|
| offsetTop | Pixels to offset from top when calculating position of scroll | number | 0 | |
|
||||||
| target | specifies the scrollable area dom node | () => HTMLElement | () => window |
|
| target | specifies the scrollable area dom node | () => HTMLElement | () => window | |
|
||||||
| onChange | Callback for when affix state is changed | Function(affixed) | - |
|
| onChange | Callback for when affix state is changed | Function(affixed) | - | |
|
||||||
|
|
||||||
**Note:** Children of `Affix` can not be `position: absolute`, but you can set `Affix` as `position: absolute`:
|
**Note:** Children of `Affix` can not be `position: absolute`, but you can set `Affix` as `position: absolute`:
|
||||||
|
|
||||||
|
@ -15,12 +15,12 @@ title: Affix
|
|||||||
|
|
||||||
## API
|
## API
|
||||||
|
|
||||||
| 成员 | 说明 | 类型 | 默认值 |
|
| 成员 | 说明 | 类型 | 默认值 | 版本 |
|
||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- | --- |
|
||||||
| offsetBottom | 距离窗口底部达到指定偏移量后触发 | number | |
|
| offsetBottom | 距离窗口底部达到指定偏移量后触发 | number | | |
|
||||||
| offsetTop | 距离窗口顶部达到指定偏移量后触发 | number | |
|
| offsetTop | 距离窗口顶部达到指定偏移量后触发 | number | | |
|
||||||
| target | 设置 `Affix` 需要监听其滚动事件的元素,值为一个返回对应 DOM 元素的函数 | () => HTMLElement | () => window |
|
| target | 设置 `Affix` 需要监听其滚动事件的元素,值为一个返回对应 DOM 元素的函数 | () => HTMLElement | () => window | |
|
||||||
| onChange | 固定状态改变时触发的回调函数 | Function(affixed) | 无 |
|
| onChange | 固定状态改变时触发的回调函数 | Function(affixed) | 无 | |
|
||||||
|
|
||||||
**注意:**`Affix` 内的元素不要使用绝对定位,如需要绝对定位的效果,可以直接设置 `Affix` 为绝对定位:
|
**注意:**`Affix` 内的元素不要使用绝对定位,如需要绝对定位的效果,可以直接设置 `Affix` 为绝对定位:
|
||||||
|
|
||||||
|
@ -13,15 +13,15 @@ Alert component for feedback.
|
|||||||
|
|
||||||
## API
|
## API
|
||||||
|
|
||||||
| Property | Description | Type | Default |
|
| Property | Description | Type | Default | Version |
|
||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- | --- |
|
||||||
| afterClose | Called when close animation is finished | () => void | - |
|
| afterClose | Called when close animation is finished | () => void | - | 3.3.1 |
|
||||||
| banner | Whether to show as banner | boolean | false |
|
| banner | Whether to show as banner | boolean | false | |
|
||||||
| closable | Whether Alert can be closed | boolean | - |
|
| closable | Whether Alert can be closed | boolean | - | |
|
||||||
| closeText | Close text to show | string\|ReactNode | - |
|
| closeText | Close text to show | string\|ReactNode | - | |
|
||||||
| description | Additional content of Alert | string\|ReactNode | - |
|
| description | Additional content of Alert | string\|ReactNode | - | |
|
||||||
| icon | Custom icon, effective when `showIcon` is `true` | ReactNode | - |
|
| icon | Custom icon, effective when `showIcon` is `true` | ReactNode | - | 3.10.0 |
|
||||||
| message | Content of Alert | string\|ReactNode | - |
|
| message | Content of Alert | string\|ReactNode | - | |
|
||||||
| showIcon | Whether to show icon | boolean | false, in `banner` mode default is true |
|
| showIcon | Whether to show icon | boolean | false, in `banner` mode default is true | |
|
||||||
| type | Type of Alert styles, options: `success`, `info`, `warning`, `error` | string | `info`, in `banner` mode default is `warning` |
|
| type | Type of Alert styles, options: `success`, `info`, `warning`, `error` | string | `info`, in `banner` mode default is `warning` | |
|
||||||
| onClose | Callback when Alert is closed | (e: MouseEvent) => void | - |
|
| onClose | Callback when Alert is closed | (e: MouseEvent) => void | - | |
|
||||||
|
@ -14,15 +14,15 @@ title: Alert
|
|||||||
|
|
||||||
## API
|
## API
|
||||||
|
|
||||||
| 参数 | 说明 | 类型 | 默认值 |
|
| 参数 | 说明 | 类型 | 默认值 | 版本 |
|
||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- | --- |
|
||||||
| afterClose | 关闭动画结束后触发的回调函数 | () => void | - |
|
| afterClose | 关闭动画结束后触发的回调函数 | () => void | - | 3.3.1 |
|
||||||
| banner | 是否用作顶部公告 | boolean | false |
|
| banner | 是否用作顶部公告 | boolean | false | |
|
||||||
| closable | 默认不显示关闭按钮 | boolean | 无 |
|
| closable | 默认不显示关闭按钮 | boolean | 无 | |
|
||||||
| closeText | 自定义关闭按钮 | string\|ReactNode | 无 |
|
| closeText | 自定义关闭按钮 | string\|ReactNode | 无 | |
|
||||||
| description | 警告提示的辅助性文字介绍 | string\|ReactNode | 无 |
|
| description | 警告提示的辅助性文字介绍 | string\|ReactNode | 无 | |
|
||||||
| icon | 自定义图标,`showIcon` 为 `true` 时有效 | ReactNode | - |
|
| icon | 自定义图标,`showIcon` 为 `true` 时有效 | ReactNode | - | 3.10.0 |
|
||||||
| message | 警告提示内容 | string\|ReactNode | 无 |
|
| message | 警告提示内容 | string\|ReactNode | 无 | |
|
||||||
| showIcon | 是否显示辅助图标 | boolean | false,`banner` 模式下默认值为 true |
|
| showIcon | 是否显示辅助图标 | boolean | false,`banner` 模式下默认值为 true | |
|
||||||
| type | 指定警告提示的样式,有四种选择 `success`、`info`、`warning`、`error` | string | `info`,`banner` 模式下默认值为 `warning` |
|
| type | 指定警告提示的样式,有四种选择 `success`、`info`、`warning`、`error` | string | `info`,`banner` 模式下默认值为 `warning` | |
|
||||||
| onClose | 关闭时触发的回调函数 | (e: MouseEvent) => void | 无 |
|
| onClose | 关闭时触发的回调函数 | (e: MouseEvent) => void | 无 | |
|
||||||
|
@ -15,19 +15,19 @@ For displaying anchor hyperlinks on page and jumping between them.
|
|||||||
|
|
||||||
### Anchor Props
|
### Anchor Props
|
||||||
|
|
||||||
| Property | Description | Type | Default |
|
| Property | Description | Type | Default | Version |
|
||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- | --- |
|
||||||
| affix | Fixed mode of Anchor | boolean | true |
|
| affix | Fixed mode of Anchor | boolean | true | |
|
||||||
| bounds | Bounding distance of anchor area | number | 5(px) |
|
| bounds | Bounding distance of anchor area | number | 5(px) | |
|
||||||
| getContainer | Scrolling container | () => HTMLElement | () => window |
|
| getContainer | Scrolling container | () => HTMLElement | () => window | 3.4.0 |
|
||||||
| offsetBottom | Pixels to offset from bottom when calculating position of scroll | number | - |
|
| offsetBottom | Pixels to offset from bottom when calculating position of scroll | number | - | |
|
||||||
| offsetTop | Pixels to offset from top when calculating position of scroll | number | 0 |
|
| offsetTop | Pixels to offset from top when calculating position of scroll | number | 0 | |
|
||||||
| showInkInFixed | Whether show ink-balls in Fixed mode | boolean | false |
|
| showInkInFixed | Whether show ink-balls in Fixed mode | boolean | false | |
|
||||||
| onClick | set the handler to handle `click` event | Function(e: Event, link: Object) | - |
|
| onClick | set the handler to handle `click` event | Function(e: Event, link: Object) | - | 3.9.0 |
|
||||||
|
|
||||||
### Link Props
|
### Link Props
|
||||||
|
|
||||||
| Property | Description | Type | Default |
|
| Property | Description | Type | Default | Version |
|
||||||
| -------- | -------------------- | ----------------- | ------- |
|
| -------- | -------------------- | ----------------- | ------- | ------- |
|
||||||
| href | target of hyperlink | string | |
|
| href | target of hyperlink | string | | |
|
||||||
| title | content of hyperlink | string\|ReactNode | |
|
| title | content of hyperlink | string\|ReactNode | | |
|
||||||
|
@ -16,19 +16,19 @@ title: Anchor
|
|||||||
|
|
||||||
### Anchor Props
|
### Anchor Props
|
||||||
|
|
||||||
| 成员 | 说明 | 类型 | 默认值 |
|
| 成员 | 说明 | 类型 | 默认值 | 版本 |
|
||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- | --- |
|
||||||
| affix | 固定模式 | boolean | true |
|
| affix | 固定模式 | boolean | true | |
|
||||||
| bounds | 锚点区域边界 | number | 5(px) |
|
| bounds | 锚点区域边界 | number | 5(px) | |
|
||||||
| getContainer | 指定滚动的容器 | () => HTMLElement | () => window |
|
| getContainer | 指定滚动的容器 | () => HTMLElement | () => window | 3.4.0 |
|
||||||
| offsetBottom | 距离窗口底部达到指定偏移量后触发 | number | |
|
| offsetBottom | 距离窗口底部达到指定偏移量后触发 | number | | |
|
||||||
| offsetTop | 距离窗口顶部达到指定偏移量后触发 | number | |
|
| offsetTop | 距离窗口顶部达到指定偏移量后触发 | number | | |
|
||||||
| showInkInFixed | 固定模式是否显示小圆点 | boolean | false |
|
| showInkInFixed | 固定模式是否显示小圆点 | boolean | false | |
|
||||||
| onClick | `click` 事件的 handler | Function(e: Event, link: Object) | - |
|
| onClick | `click` 事件的 handler | Function(e: Event, link: Object) | - | 3.9.0 |
|
||||||
|
|
||||||
### Link Props
|
### Link Props
|
||||||
|
|
||||||
| 成员 | 说明 | 类型 | 默认值 |
|
| 成员 | 说明 | 类型 | 默认值 | 版本 |
|
||||||
| ----- | -------- | ----------------- | ------ |
|
| ----- | -------- | ----------------- | ------ | ---- |
|
||||||
| href | 锚点链接 | string | |
|
| href | 锚点链接 | string | | |
|
||||||
| title | 文字内容 | string\|ReactNode | |
|
| title | 文字内容 | string\|ReactNode | | |
|
||||||
|
@ -18,33 +18,33 @@ const dataSource = ['12345', '23456', '34567'];
|
|||||||
<AutoComplete dataSource={dataSource} />;
|
<AutoComplete dataSource={dataSource} />;
|
||||||
```
|
```
|
||||||
|
|
||||||
| Property | Description | Type | Default |
|
| Property | Description | Type | Default | Version |
|
||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- | --- |
|
||||||
| allowClear | Show clear button, effective in multiple mode only. | boolean | false |
|
| allowClear | Show clear button, effective in multiple mode only. | boolean | false | |
|
||||||
| autoFocus | get focus when component mounted | boolean | false |
|
| autoFocus | get focus when component mounted | boolean | false | |
|
||||||
| backfill | backfill selected item the input when using keyboard | boolean | false |
|
| backfill | backfill selected item the input when using keyboard | boolean | false | |
|
||||||
| children (for customize input element) | customize input element | HTMLInputElement / HTMLTextAreaElement / React.ReactElement<InputProps> | `<Input />` |
|
| children (for customize input element) | customize input element | HTMLInputElement / HTMLTextAreaElement / React.ReactElement<InputProps> | `<Input />` | |
|
||||||
| children (for dataSource) | Data source for autocomplete | React.ReactElement<OptionProps> / Array<React.ReactElement<OptionProps>> | - |
|
| children (for dataSource) | Data source for autocomplete | React.ReactElement<OptionProps> / Array<React.ReactElement<OptionProps>> | - | |
|
||||||
| dataSource | Data source for autocomplete | [DataSourceItemType](https://git.io/vMMKF)\[] | |
|
| dataSource | Data source for autocomplete | [DataSourceItemType](https://git.io/vMMKF)\[] | - | |
|
||||||
| defaultActiveFirstOption | Whether active first option by default | boolean | true |
|
| defaultActiveFirstOption | Whether active first option by default | boolean | true | |
|
||||||
| defaultValue | Initial selected option. | string\|string\[]\| - |
|
| defaultValue | Initial selected option. | string\|string\[] | - | |
|
||||||
| disabled | Whether disabled select | boolean | false |
|
| disabled | Whether disabled select | boolean | false | |
|
||||||
| filterOption | If true, filter options by input, if function, filter options against it. The function will receive two arguments, `inputValue` and `option`, if the function returns `true`, the option will be included in the filtered set; Otherwise, it will be excluded. | boolean or function(inputValue, option) | true |
|
| filterOption | If true, filter options by input, if function, filter options against it. The function will receive two arguments, `inputValue` and `option`, if the function returns `true`, the option will be included in the filtered set; Otherwise, it will be excluded. | boolean or function(inputValue, option) | true | |
|
||||||
| optionLabelProp | Which prop value of option will render as content of select. | string | `children` |
|
| optionLabelProp | Which prop value of option will render as content of select. | string | `children` | |
|
||||||
| placeholder | placeholder of input | string | - |
|
| placeholder | placeholder of input | string | - | |
|
||||||
| value | selected option | string\|string\[]\|{ key: string, label: string\|ReactNode }\|Array<{ key: string, label: string\|ReactNode }> | - |
|
| value | selected option | string\|string\[]\|{ key: string, label: string\|ReactNode }\|Array<{ key: string, label: string\|ReactNode }> | - | |
|
||||||
| onBlur | Called when leaving the component. | function() | - |
|
| onBlur | Called when leaving the component. | function() | - | 3.6.5 |
|
||||||
| onChange | Called when select an option or input value change, or value of input is changed | function(value) | - |
|
| onChange | Called when select an option or input value change, or value of input is changed | function(value) | - | |
|
||||||
| onFocus | Called when entering the component | function() | - |
|
| onFocus | Called when entering the component | function() | - | 3.6.5 |
|
||||||
| onSearch | Called when searching items. | function(value) | - |
|
| onSearch | Called when searching items. | function(value) | - | |
|
||||||
| onSelect | Called when a option is selected. param is option's value and option instance. | function(value, option) | - |
|
| onSelect | Called when a option is selected. param is option's value and option instance. | function(value, option) | - | |
|
||||||
| defaultOpen | Initial open state of dropdown | boolean | - |
|
| defaultOpen | Initial open state of dropdown | boolean | - | 3.9.3 |
|
||||||
| open | Controlled open state of dropdown | boolean | - |
|
| open | Controlled open state of dropdown | boolean | - | 3.9.3 |
|
||||||
| onDropdownVisibleChange | Call when dropdown open | function(open) | - |
|
| onDropdownVisibleChange | Call when dropdown open | function(open) | - | 3.9.3 |
|
||||||
|
|
||||||
## Methods
|
## Methods
|
||||||
|
|
||||||
| Name | Description |
|
| Name | Description | Version |
|
||||||
| ------- | ------------ |
|
| ------- | ------------ | ------- |
|
||||||
| blur() | remove focus |
|
| blur() | remove focus | |
|
||||||
| focus() | get focus |
|
| focus() | get focus | |
|
||||||
|
@ -19,34 +19,34 @@ const dataSource = ['12345', '23456', '34567'];
|
|||||||
<AutoComplete dataSource={dataSource} />;
|
<AutoComplete dataSource={dataSource} />;
|
||||||
```
|
```
|
||||||
|
|
||||||
| 参数 | 说明 | 类型 | 默认值 |
|
| 参数 | 说明 | 类型 | 默认值 | 版本 |
|
||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- | --- |
|
||||||
| allowClear | 支持清除, 单选模式有效 | boolean | false |
|
| allowClear | 支持清除, 单选模式有效 | boolean | false | |
|
||||||
| autoFocus | 自动获取焦点 | boolean | false |
|
| autoFocus | 自动获取焦点 | boolean | false | |
|
||||||
| backfill | 使用键盘选择选项的时候把选中项回填到输入框中 | boolean | false |
|
| backfill | 使用键盘选择选项的时候把选中项回填到输入框中 | boolean | false | |
|
||||||
| children (自动完成的数据源) | 自动完成的数据源 | React.ReactElement<OptionProps> / Array<React.ReactElement<OptionProps>> | - |
|
| children (自动完成的数据源) | 自动完成的数据源 | React.ReactElement<OptionProps> / Array<React.ReactElement<OptionProps>> | - | | |
|
||||||
| children (自定义输入框) | 自定义输入框 | HTMLInputElement / HTMLTextAreaElement / React.ReactElement<InputProps> | `<Input />` |
|
| children (自定义输入框) | 自定义输入框 | HTMLInputElement / HTMLTextAreaElement / React.ReactElement<InputProps> | `<Input />` | @todo.muyu |
|
||||||
| dataSource | 自动完成的数据源 | [DataSourceItemType](https://git.io/vMMKF)\[] | |
|
| dataSource | 自动完成的数据源 | [DataSourceItemType](https://git.io/vMMKF)\[] | | |
|
||||||
| defaultActiveFirstOption | 是否默认高亮第一个选项。 | boolean | true |
|
| defaultActiveFirstOption | 是否默认高亮第一个选项。 | boolean | true | |
|
||||||
| defaultValue | 指定默认选中的条目 | string\|string\[]\| 无 |
|
| defaultValue | 指定默认选中的条目 | string\|string\[]\| 无 | |
|
||||||
| disabled | 是否禁用 | boolean | false |
|
| disabled | 是否禁用 | boolean | false | |
|
||||||
| filterOption | 是否根据输入项进行筛选。当其为一个函数时,会接收 `inputValue` `option` 两个参数,当 `option` 符合筛选条件时,应返回 `true`,反之则返回 `false`。 | boolean or function(inputValue, option) | true |
|
| filterOption | 是否根据输入项进行筛选。当其为一个函数时,会接收 `inputValue` `option` 两个参数,当 `option` 符合筛选条件时,应返回 `true`,反之则返回 `false`。 | boolean or function(inputValue, option) | true | |
|
||||||
| getPopupContainer | 菜单渲染父节点。默认渲染到 body 上,如果你遇到菜单滚动定位问题,试试修改为滚动的区域,并相对其定位。[示例](https://codesandbox.io/s/4j168r7jw0) | Function(triggerNode) | () => document.body |
|
| getPopupContainer | 菜单渲染父节点。默认渲染到 body 上,如果你遇到菜单滚动定位问题,试试修改为滚动的区域,并相对其定位。[示例](https://codesandbox.io/s/4j168r7jw0) | Function(triggerNode) | () => document.body | 3.19.4 |
|
||||||
| optionLabelProp | 回填到选择框的 Option 的属性值,默认是 Option 的子元素。比如在子元素需要高亮效果时,此值可以设为 `value`。 | string | `children` |
|
| optionLabelProp | 回填到选择框的 Option 的属性值,默认是 Option 的子元素。比如在子元素需要高亮效果时,此值可以设为 `value`。 | string | `children` | |
|
||||||
| placeholder | 输入框提示 | string | - |
|
| placeholder | 输入框提示 | string | - | |
|
||||||
| value | 指定当前选中的条目 | string\|string\[]\|{ key: string, label: string\|ReactNode }\|Array<{ key: string, label: string\|ReactNode }> | 无 |
|
| value | 指定当前选中的条目 | string\|string\[]\|{ key: string, label: string\|ReactNode }\|Array<{ key: string, label: string\|ReactNode }> | 无 | |
|
||||||
| onBlur | 失去焦点时的回调 | function() | - |
|
| onBlur | 失去焦点时的回调 | function() | - | 3.6.5 |
|
||||||
| onChange | 选中 option,或 input 的 value 变化时,调用此函数 | function(value) | 无 |
|
| onChange | 选中 option,或 input 的 value 变化时,调用此函数 | function(value) | 无 | |
|
||||||
| onFocus | 获得焦点时的回调 | function() | - |
|
| onFocus | 获得焦点时的回调 | function() | - | 3.6.5 |
|
||||||
| onSearch | 搜索补全项的时候调用 | function(value) | 无 |
|
| onSearch | 搜索补全项的时候调用 | function(value) | 无 | |
|
||||||
| onSelect | 被选中时调用,参数为选中项的 value 值 | function(value, option) | 无 |
|
| onSelect | 被选中时调用,参数为选中项的 value 值 | function(value, option) | 无 | |
|
||||||
| defaultOpen | 是否默认展开下拉菜单 | boolean | - |
|
| defaultOpen | 是否默认展开下拉菜单 | boolean | - | 3.9.3 |
|
||||||
| open | 是否展开下拉菜单 | boolean | - |
|
| open | 是否展开下拉菜单 | boolean | - | 3.9.3 |
|
||||||
| onDropdownVisibleChange | 展开下拉菜单的回调 | function(open) | - |
|
| onDropdownVisibleChange | 展开下拉菜单的回调 | function(open) | - | 3.9.3 |
|
||||||
|
|
||||||
## 方法
|
## 方法
|
||||||
|
|
||||||
| 名称 | 描述 |
|
| 名称 | 描述 | 版本 |
|
||||||
| ------- | -------- |
|
| ------- | -------- | ---- |
|
||||||
| blur() | 移除焦点 |
|
| blur() | 移除焦点 | |
|
||||||
| focus() | 获取焦点 |
|
| focus() | 获取焦点 | |
|
||||||
|
@ -8,12 +8,12 @@ Avatars can be used to represent people or objects. It supports images, `Icon`s,
|
|||||||
|
|
||||||
## API
|
## API
|
||||||
|
|
||||||
| Property | Description | Type | Default |
|
| Property | Description | Type | Default | Version |
|
||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- | --- |
|
||||||
| icon | the `Icon` type for an icon avatar, see `Icon` Component | string | - |
|
| icon | the `Icon` type for an icon avatar, see `Icon` Component | string | - | |
|
||||||
| shape | the shape of avatar | `circle` \| `square` | `circle` |
|
| shape | the shape of avatar | `circle` \| `square` | `circle` | |
|
||||||
| size | the size of the avatar | number \| string: `large` `small` `default` | `default` |
|
| size | the size of the avatar | number \| string: `large` `small` `default` | `default` | |
|
||||||
| src | the address of the image for an image avatar | string | - |
|
| src | the address of the image for an image avatar | string | - | |
|
||||||
| srcSet | a list of sources to use for different screen resolutions | string | - |
|
| srcSet | a list of sources to use for different screen resolutions | string | - | 3.11.0 |
|
||||||
| alt | This attribute defines the alternative text describing the image | string | - |
|
| alt | This attribute defines the alternative text describing the image | string | - | 3.7.0 |
|
||||||
| onError | handler when img load error, return false to prevent default fallback behavior | () => boolean | - |
|
| onError | handler when img load error, return false to prevent default fallback behavior | () => boolean | - | 3.8.0 |
|
||||||
|
@ -13,12 +13,12 @@ title: Avatar
|
|||||||
|
|
||||||
## API
|
## API
|
||||||
|
|
||||||
| 参数 | 说明 | 类型 | 默认值 |
|
| 参数 | 说明 | 类型 | 默认值 | 版本 |
|
||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- | --- |
|
||||||
| icon | 设置头像的图标类型,参考 `Icon` 组件 | string | - |
|
| icon | 设置头像的图标类型,参考 `Icon` 组件 | string | - | |
|
||||||
| shape | 指定头像的形状 | Enum{ 'circle', 'square' } | `circle` |
|
| shape | 指定头像的形状 | Enum{ 'circle', 'square' } | `circle` | |
|
||||||
| size | 设置头像的大小 | number \| Enum{ 'large', 'small', 'default' } | `default` |
|
| size | 设置头像的大小 | number \| Enum{ 'large', 'small', 'default' } | `default` | |
|
||||||
| src | 图片类头像的资源地址 | string | - |
|
| src | 图片类头像的资源地址 | string | - | |
|
||||||
| srcSet | 设置图片类头像响应式资源地址 | string | - |
|
| srcSet | 设置图片类头像响应式资源地址 | string | - | 3.11.0 |
|
||||||
| alt | 图像无法显示时的替代文本 | string | - |
|
| alt | 图像无法显示时的替代文本 | string | - | 3.7.0 |
|
||||||
| onError | 图片加载失败的事件,返回 false 会关闭组件默认的 fallback 行为 | () => boolean | - |
|
| onError | 图片加载失败的事件,返回 false 会关闭组件默认的 fallback 行为 | () => boolean | - | 3.8.0 |
|
||||||
|
@ -17,8 +17,8 @@ title: BackTop
|
|||||||
>
|
>
|
||||||
> If you decide to use custom styles, please note the size limit: no more than `40px * 40px`.
|
> If you decide to use custom styles, please note the size limit: no more than `40px * 40px`.
|
||||||
|
|
||||||
| Property | Description | Type | Default |
|
| Property | Description | Type | Default | Version |
|
||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- | --- |
|
||||||
| target | specifies the scrollable area dom node | () => HTMLElement | () => window |
|
| target | specifies the scrollable area dom node | () => HTMLElement | () => window | |
|
||||||
| visibilityHeight | the `BackTop` button will not show until the scroll height reaches this value | number | 400 |
|
| visibilityHeight | the `BackTop` button will not show until the scroll height reaches this value | number | 400 | |
|
||||||
| onClick | a callback function, which can be executed when you click the button | Function | - |
|
| onClick | a callback function, which can be executed when you click the button | Function | - | |
|
||||||
|
@ -18,8 +18,8 @@ title: BackTop
|
|||||||
>
|
>
|
||||||
> 自定义样式宽高不大于 40px \* 40px。
|
> 自定义样式宽高不大于 40px \* 40px。
|
||||||
|
|
||||||
| 参数 | 说明 | 类型 | 默认值 |
|
| 参数 | 说明 | 类型 | 默认值 | 版本 |
|
||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- | --- |
|
||||||
| target | 设置需要监听其滚动事件的元素,值为一个返回对应 DOM 元素的函数 | Function | () => window |
|
| target | 设置需要监听其滚动事件的元素,值为一个返回对应 DOM 元素的函数 | Function | () => window | |
|
||||||
| visibilityHeight | 滚动高度达到此参数值才出现 `BackTop` | number | 400 |
|
| visibilityHeight | 滚动高度达到此参数值才出现 `BackTop` | number | 400 | |
|
||||||
| onClick | 点击按钮的回调函数 | Function | - |
|
| onClick | 点击按钮的回调函数 | Function | - | |
|
||||||
|
@ -32,4 +32,4 @@ Badge normally appears in proximity to notifications or user avatars with eye-ca
|
|||||||
| showZero | Whether to show badge when `count` is zero | boolean | `false` | |
|
| showZero | Whether to show badge when `count` is zero | boolean | `false` | |
|
||||||
| status | Set Badge as a status dot | `success` \| `processing` \| `default` \| `error` \| `warning` | `''` | |
|
| status | Set Badge as a status dot | `success` \| `processing` \| `default` \| `error` \| `warning` | `''` | |
|
||||||
| text | If `status` is set, `text` sets the display text of the status `dot` | string | `''` | |
|
| text | If `status` is set, `text` sets the display text of the status `dot` | string | `''` | |
|
||||||
| title | Text to show when hovering over the badge | string | `count` | |
|
| title | Text to show when hovering over the badge | string | `count` | 3.5.0 |
|
||||||
|
@ -33,4 +33,4 @@ title: Badge
|
|||||||
| showZero | 当数值为 0 时,是否展示 Badge | boolean | false | |
|
| showZero | 当数值为 0 时,是否展示 Badge | boolean | false | |
|
||||||
| status | 设置 Badge 为状态点 | Enum{ 'success', 'processing, 'default', 'error', 'warning' } | '' | |
|
| status | 设置 Badge 为状态点 | Enum{ 'success', 'processing, 'default', 'error', 'warning' } | '' | |
|
||||||
| text | 在设置了 `status` 的前提下有效,设置状态点的文本 | string | '' | |
|
| text | 在设置了 `status` 的前提下有效,设置状态点的文本 | string | '' | |
|
||||||
| title | 设置鼠标放在状态点上时显示的文字 | string | `count` | |
|
| title | 设置鼠标放在状态点上时显示的文字 | string | `count` | 3.5.0 |
|
||||||
|
@ -15,12 +15,12 @@ A breadcrumb displays the current location within a hierarchy. It allows going b
|
|||||||
|
|
||||||
## API
|
## API
|
||||||
|
|
||||||
| Property | Description | Type | Optional | Default |
|
| Property | Description | Type | Optional | Default | Version |
|
||||||
| --- | --- | --- | --- | --- |
|
| --- | --- | --- | --- | --- | --- |
|
||||||
| itemRender | Custom item renderer | (route, params, routes, paths) => ReactNode | | - |
|
| itemRender | Custom item renderer | (route, params, routes, paths) => ReactNode | | - | |
|
||||||
| params | Routing parameters | object | | - |
|
| params | Routing parameters | object | | - | |
|
||||||
| routes | The routing stack information of router | [routes\[\]](#routes) | | - |
|
| routes | The routing stack information of router | [routes\[\]](#routes) | | - | |
|
||||||
| separator | Custom separator | string\|ReactNode | | `/` |
|
| separator | Custom separator | string\|ReactNode | | `/` | |
|
||||||
|
|
||||||
### Use with browserHistory
|
### Use with browserHistory
|
||||||
|
|
||||||
|
@ -17,21 +17,21 @@ title: Breadcrumb
|
|||||||
|
|
||||||
### Breadcrumb
|
### Breadcrumb
|
||||||
|
|
||||||
| 参数 | 说明 | 类型 | 默认值 |
|
| 参数 | 说明 | 类型 | 默认值 | 版本 |
|
||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- | --- |
|
||||||
| itemRender | 自定义链接函数,和 react-router 配置使用 | (route, params, routes, paths) => ReactNode | - |
|
| itemRender | 自定义链接函数,和 react-router 配置使用 | (route, params, routes, paths) => ReactNode | - | 3.17.0 |
|
||||||
| params | 路由的参数 | object | - |
|
| params | 路由的参数 | object | - | 3.17.0 |
|
||||||
| routes | router 的路由栈信息 | [routes\[\]](#routes) | - |
|
| routes | router 的路由栈信息 | [routes\[\]](#routes) | - | 3.17.0 |
|
||||||
| separator | 分隔符自定义 | string\|ReactNode | '/' |
|
| separator | 分隔符自定义 | string\|ReactNode | '/' | 3.17.0 |
|
||||||
|
|
||||||
### Breadcrumb.Item
|
### Breadcrumb.Item
|
||||||
|
|
||||||
| 参数 | 参数 | 类型 | 默认值 |
|
| 参数 | 参数 | 类型 | 默认值 | 版本 |
|
||||||
| --------- | -------------- | -------------------------------------- | ------ |
|
| --------- | -------------- | -------------------------------------- | ------ | ------ |
|
||||||
| href | 链接的目的地 | string | - |
|
| href | 链接的目的地 | string | - | 3.17.0 |
|
||||||
| separator | 自定义的分隔符 | string\|ReactNode | '/' |
|
| separator | 自定义的分隔符 | string\|ReactNode | '/' | 3.17.0 |
|
||||||
| overlay | 下来菜单的内容 | [Menu](/components/menu) \| () => Menu | - |
|
| overlay | 下来菜单的内容 | [Menu](/components/menu) \| () => Menu | - | 3.17.0 |
|
||||||
| onClick | 单击事件 | (e:MouseEvent)=>void | - |
|
| onClick | 单击事件 | (e:MouseEvent)=>void | - | 3.17.0 |
|
||||||
|
|
||||||
### routes
|
### routes
|
||||||
|
|
||||||
|
@ -14,20 +14,20 @@ A button means an operation (or a series of operations). Clicking a button will
|
|||||||
|
|
||||||
To get a customized button, just set `type`/`shape`/`size`/`loading`/`disabled`.
|
To get a customized button, just set `type`/`shape`/`size`/`loading`/`disabled`.
|
||||||
|
|
||||||
| Property | Description | Type | Default |
|
| Property | Description | Type | Default | Version |
|
||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- | --- |
|
||||||
| disabled | disabled state of button | boolean | `false` |
|
| disabled | disabled state of button | boolean | `false` | 3.5.1 |
|
||||||
| ghost | make background transparent and invert text and border colors, added in 2.7 | boolean | `false` |
|
| ghost | make background transparent and invert text and border colors, added in 2.7 | boolean | `false` | |
|
||||||
| href | redirect url of link button | string | - |
|
| href | redirect url of link button | string | - | |
|
||||||
| htmlType | set the original html `type` of `button`, see: [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#attr-type) | string | `button` |
|
| htmlType | set the original html `type` of `button`, see: [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#attr-type) | string | `button` | |
|
||||||
| icon | set the icon of button, see: Icon component | string | - |
|
| icon | set the icon of button, see: Icon component | string | - | |
|
||||||
| loading | set the loading status of button | boolean \| { delay: number } | `false` |
|
| loading | set the loading status of button | boolean \| { delay: number } | `false` | |
|
||||||
| shape | can be set to `circle`, `round` or omitted | string | - |
|
| shape | can be set to `circle`, `round` or omitted | string | - | |
|
||||||
| size | can be set to `small` `large` or omitted | string | `default` |
|
| size | can be set to `small` `large` or omitted | string | `default` | |
|
||||||
| target | same as target attribute of a, works when href is specified | string | - |
|
| target | same as target attribute of a, works when href is specified | string | - | |
|
||||||
| type | can be set to `primary` `ghost` `dashed` `danger` `link`(added in 3.17) or omitted (meaning `default`) | string | `default` |
|
| type | can be set to `primary` `ghost` `dashed` `danger` `link`(added in 3.17) or omitted (meaning `default`) | string | `default` | |
|
||||||
| onClick | set the handler to handle `click` event | (event) => void | - |
|
| onClick | set the handler to handle `click` event | (event) => void | - | |
|
||||||
| block | option to fit button width to its parent width | boolean | `false` |
|
| block | option to fit button width to its parent width | boolean | `false` | 3.8.0 |
|
||||||
|
|
||||||
It accepts all props which native button support.
|
It accepts all props which native button support.
|
||||||
|
|
||||||
|
@ -17,20 +17,20 @@ subtitle: 按钮
|
|||||||
|
|
||||||
按钮的属性说明如下:
|
按钮的属性说明如下:
|
||||||
|
|
||||||
| 属性 | 说明 | 类型 | 默认值 |
|
| 属性 | 说明 | 类型 | 默认值 | 版本 |
|
||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- | --- |
|
||||||
| disabled | 按钮失效状态 | boolean | `false` |
|
| disabled | 按钮失效状态 | boolean | `false` | 3.5.1 |
|
||||||
| ghost | 幽灵属性,使按钮背景透明,版本 2.7 中增加 | boolean | false |
|
| ghost | 幽灵属性,使按钮背景透明,版本 2.7 中增加 | boolean | false | |
|
||||||
| href | 点击跳转的地址,指定此属性 button 的行为和 a 链接一致 | string | - |
|
| href | 点击跳转的地址,指定此属性 button 的行为和 a 链接一致 | string | - | |
|
||||||
| htmlType | 设置 `button` 原生的 `type` 值,可选值请参考 [HTML 标准](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#attr-type) | string | `button` |
|
| htmlType | 设置 `button` 原生的 `type` 值,可选值请参考 [HTML 标准](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#attr-type) | string | `button` | |
|
||||||
| icon | 设置按钮的图标类型 | string | - |
|
| icon | 设置按钮的图标类型 | string | - | |
|
||||||
| loading | 设置按钮载入状态 | boolean \| { delay: number } | `false` |
|
| loading | 设置按钮载入状态 | boolean \| { delay: number } | `false` | |
|
||||||
| shape | 设置按钮形状,可选值为 `circle`、 `round` 或者不设 | string | - |
|
| shape | 设置按钮形状,可选值为 `circle`、 `round` 或者不设 | string | - | |
|
||||||
| size | 设置按钮大小,可选值为 `small` `large` 或者不设 | string | `default` |
|
| size | 设置按钮大小,可选值为 `small` `large` 或者不设 | string | `default` | |
|
||||||
| target | 相当于 a 链接的 target 属性,href 存在时生效 | string | - |
|
| target | 相当于 a 链接的 target 属性,href 存在时生效 | string | - | |
|
||||||
| type | 设置按钮类型,可选值为 `primary` `dashed` `danger` `link`(3.17 中增加) 或者不设 | string | - |
|
| type | 设置按钮类型,可选值为 `primary` `dashed` `danger` `link`(3.17 中增加) 或者不设 | string | - | |
|
||||||
| onClick | 点击按钮时的回调 | (event) => void | - |
|
| onClick | 点击按钮时的回调 | (event) => void | - | |
|
||||||
| block | 将按钮宽度调整为其父宽度的选项 | boolean | `false` |
|
| block | 将按钮宽度调整为其父宽度的选项 | boolean | `false` | 3.8.0 |
|
||||||
|
|
||||||
支持原生 button 的其他所有属性。
|
支持原生 button 的其他所有属性。
|
||||||
|
|
||||||
|
@ -40,9 +40,9 @@ When data is in the form of dates, such as schedules, timetables, prices calenda
|
|||||||
| mode | The display mode of the calendar | `month` \| `year` | `month` | |
|
| mode | The display mode of the calendar | `month` \| `year` | `month` | |
|
||||||
| monthCellRender | Customize the display of the month cell, the returned content will be appended to the cell | function(date: moment): ReactNode | - | |
|
| monthCellRender | Customize the display of the month cell, the returned content will be appended to the cell | function(date: moment): ReactNode | - | |
|
||||||
| monthFullCellRender | Customize the display of the month cell, the returned content will override the cell | function(date: moment): ReactNode | - | |
|
| monthFullCellRender | Customize the display of the month cell, the returned content will override the cell | function(date: moment): ReactNode | - | |
|
||||||
| validRange | to set valid range | \[[moment](http://momentjs.com/), [moment](http://momentjs.com/)] | - | |
|
| validRange | to set valid range | \[[moment](http://momentjs.com/), [moment](http://momentjs.com/)] | - | 3.3.0 |
|
||||||
| value | The current selected date | [moment](http://momentjs.com/) | current date |
|
| value | The current selected date | [moment](http://momentjs.com/) | current date | |
|
||||||
| onPanelChange | Callback for when panel changes | function(date: moment, mode: string) | - | |
|
| onPanelChange | Callback for when panel changes | function(date: moment, mode: string) | - | |
|
||||||
| onSelect | Callback for when a date is selected | function(date: moment) | - | |
|
| onSelect | Callback for when a date is selected | function(date: moment) | - | |
|
||||||
| onChange | Callback for when date changes | function(date: moment) | - | |
|
| onChange | Callback for when date changes | function(date: moment) | - | 3.8.0 |
|
||||||
| headerRender | render custom header in panel | function(object:{value: moment, type: string, onChange: f(), onTypeChange: f()}) | - | 3.19.0 |
|
| headerRender | render custom header in panel | function(object:{value: moment, type: string, onChange: f(), onTypeChange: f()}) | - | 3.19.0 |
|
||||||
|
@ -34,16 +34,16 @@ title: Calendar
|
|||||||
| --- | --- | --- | --- | --- |
|
| --- | --- | --- | --- | --- |
|
||||||
| dateCellRender | 自定义渲染日期单元格,返回内容会被追加到单元格 | function(date: moment): ReactNode | 无 | |
|
| dateCellRender | 自定义渲染日期单元格,返回内容会被追加到单元格 | function(date: moment): ReactNode | 无 | |
|
||||||
| dateFullCellRender | 自定义渲染日期单元格,返回内容覆盖单元格 | function(date: moment): ReactNode | 无 | |
|
| dateFullCellRender | 自定义渲染日期单元格,返回内容覆盖单元格 | function(date: moment): ReactNode | 无 | |
|
||||||
| defaultValue | 默认展示的日期 | [moment](http://momentjs.com/) | 默认日期 |
|
| defaultValue | 默认展示的日期 | [moment](http://momentjs.com/) | 默认日期 | |
|
||||||
| disabledDate | 不可选择的日期 | (currentDate: moment) => boolean | 无 | |
|
| disabledDate | 不可选择的日期 | (currentDate: moment) => boolean | 无 | |
|
||||||
| fullscreen | 是否全屏显示 | boolean | true | |
|
| fullscreen | 是否全屏显示 | boolean | true | |
|
||||||
| locale | 国际化配置 | object | [默认配置](https://github.com/ant-design/ant-design/blob/master/components/date-picker/locale/example.json) | |
|
| locale | 国际化配置 | object | [默认配置](https://github.com/ant-design/ant-design/blob/master/components/date-picker/locale/example.json) | |
|
||||||
| mode | 初始模式,`month/year` | string | month |
|
| mode | 初始模式,`month/year` | string | month | |
|
||||||
| monthCellRender | 自定义渲染月单元格,返回内容会被追加到单元格 | function(date: moment): ReactNode | 无 | |
|
| monthCellRender | 自定义渲染月单元格,返回内容会被追加到单元格 | function(date: moment): ReactNode | 无 | |
|
||||||
| monthFullCellRender | 自定义渲染月单元格,返回内容覆盖单元格 | function(date: moment): ReactNode | 无 | |
|
| monthFullCellRender | 自定义渲染月单元格,返回内容覆盖单元格 | function(date: moment): ReactNode | 无 | |
|
||||||
| validRange | 设置可以显示的日期 | \[[moment](http://momentjs.com/), [moment](http://momentjs.com/)] | 无 | |
|
| validRange | 设置可以显示的日期 | \[[moment](http://momentjs.com/), [moment](http://momentjs.com/)] | 无 | 3.3.0 |
|
||||||
| value | 展示日期 | [moment](http://momentjs.com/) | 当前日期 |
|
| value | 展示日期 | [moment](http://momentjs.com/) | 当前日期 | |
|
||||||
| onPanelChange | 日期面板变化回调 | function(date: moment, mode: string) | 无 | |
|
| onPanelChange | 日期面板变化回调 | function(date: moment, mode: string) | 无 | |
|
||||||
| onSelect | 点击选择日期回调 | function(date: moment) | 无 | |
|
| onSelect | 点击选择日期回调 | function(date: moment) | 无 | |
|
||||||
| onChange | 日期变化回调 | function(date: moment) | 无 | |
|
| onChange | 日期变化回调 | function(date: moment) | 无 | 3.8.0 |
|
||||||
| headerRender | 自定义头部内容 | function(object:{value: moment, type: string, onChange: f(), onTypeChange: f()}) | 无 | 3.19.0 |
|
| headerRender | 自定义头部内容 | function(object:{value: moment, type: string, onChange: f(), onTypeChange: f()}) | 无 | 3.19.0 |
|
||||||
|
@ -19,37 +19,37 @@ A card can be used to display content related to a single subject. The content c
|
|||||||
|
|
||||||
### Card
|
### Card
|
||||||
|
|
||||||
| Property | Description | Type | Default |
|
| Property | Description | Type | Default | Version |
|
||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- | --- |
|
||||||
| actions | The action list, shows at the bottom of the Card. | Array<ReactNode> | - |
|
| actions | The action list, shows at the bottom of the Card. | Array<ReactNode> | - | |
|
||||||
| activeTabKey | Current TabPane's key | string | - |
|
| activeTabKey | Current TabPane's key | string | - | 3.3.0 |
|
||||||
| headStyle | Inline style to apply to the card head | object | - |
|
| headStyle | Inline style to apply to the card head | object | - | 3.8.0 |
|
||||||
| bodyStyle | Inline style to apply to the card content | object | - |
|
| bodyStyle | Inline style to apply to the card content | object | - | |
|
||||||
| bordered | Toggles rendering of the border around the card | boolean | `true` |
|
| bordered | Toggles rendering of the border around the card | boolean | `true` | |
|
||||||
| cover | Card cover | ReactNode | - |
|
| cover | Card cover | ReactNode | - | |
|
||||||
| defaultActiveTabKey | Initial active TabPane's key, if `activeTabKey` is not set. | string | - |
|
| defaultActiveTabKey | Initial active TabPane's key, if `activeTabKey` is not set. | string | - | 3.3.0 |
|
||||||
| extra | Content to render in the top-right corner of the card | string\|ReactNode | - |
|
| extra | Content to render in the top-right corner of the card | string\|ReactNode | - | |
|
||||||
| hoverable | Lift up when hovering card | boolean | false |
|
| hoverable | Lift up when hovering card | boolean | false | |
|
||||||
| loading | Shows a loading indicator while the contents of the card are being fetched | boolean | false |
|
| loading | Shows a loading indicator while the contents of the card are being fetched | boolean | false | |
|
||||||
| tabList | List of TabPane's head. | Array<{key: string, tab: ReactNode}> | - |
|
| tabList | List of TabPane's head. | Array<{key: string, tab: ReactNode}> | - | |
|
||||||
| size | Size of card | `default` \| `small` | `default` |
|
| size | Size of card | `default` \| `small` | `default` | 3.12.0 |
|
||||||
| title | Card title | string\|ReactNode | - |
|
| title | Card title | string\|ReactNode | - | |
|
||||||
| type | Card style type, can be set to `inner` or not set | string | - |
|
| type | Card style type, can be set to `inner` or not set | string | - | |
|
||||||
| onTabChange | Callback when tab is switched | (key) => void | - |
|
| onTabChange | Callback when tab is switched | (key) => void | - | |
|
||||||
|
|
||||||
### Card.Grid
|
### Card.Grid
|
||||||
|
|
||||||
| Property | Description | Type | Default |
|
| Property | Description | Type | Default | Version |
|
||||||
| --------- | ------------------------- | ------ | ------- |
|
| --------- | ------------------------- | ------ | ------- | ------- |
|
||||||
| className | className of container | string | - |
|
| className | className of container | string | - | |
|
||||||
| style | style object of container | object | - |
|
| style | style object of container | object | - | |
|
||||||
|
|
||||||
### Card.Meta
|
### Card.Meta
|
||||||
|
|
||||||
| Property | Description | Type | Default |
|
| Property | Description | Type | Default | Version |
|
||||||
| ----------- | ------------------------- | --------- | ------- |
|
| ----------- | ------------------------- | --------- | ------- | ------- |
|
||||||
| avatar | avatar or icon | ReactNode | - |
|
| avatar | avatar or icon | ReactNode | - | |
|
||||||
| className | className of container | string | - |
|
| className | className of container | string | - | |
|
||||||
| description | description content | ReactNode | - |
|
| description | description content | ReactNode | - | |
|
||||||
| style | style object of container | object | - |
|
| style | style object of container | object | - | |
|
||||||
| title | title content | ReactNode | - |
|
| title | title content | ReactNode | - | |
|
||||||
|
@ -20,37 +20,37 @@ cols: 1
|
|||||||
|
|
||||||
### Card
|
### Card
|
||||||
|
|
||||||
| 参数 | 说明 | 类型 | 默认值 |
|
| 参数 | 说明 | 类型 | 默认值 | 版本 |
|
||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- | --- |
|
||||||
| actions | 卡片操作组,位置在卡片底部 | Array<ReactNode> | - |
|
| actions | 卡片操作组,位置在卡片底部 | Array<ReactNode> | - | |
|
||||||
| activeTabKey | 当前激活页签的 key | string | - |
|
| activeTabKey | 当前激活页签的 key | string | - | 3.3.0 |
|
||||||
| headStyle | 自定义标题区域样式 | object | - |
|
| headStyle | 自定义标题区域样式 | object | - | 3.8.0 |
|
||||||
| bodyStyle | 内容区域自定义样式 | object | - |
|
| bodyStyle | 内容区域自定义样式 | object | - | |
|
||||||
| bordered | 是否有边框 | boolean | true |
|
| bordered | 是否有边框 | boolean | true | |
|
||||||
| cover | 卡片封面 | ReactNode | - |
|
| cover | 卡片封面 | ReactNode | - | |
|
||||||
| defaultActiveTabKey | 初始化选中页签的 key,如果没有设置 activeTabKey | string | 第一个页签 |
|
| defaultActiveTabKey | 初始化选中页签的 key,如果没有设置 activeTabKey | string | 第一个页签 | 3.3.0 |
|
||||||
| extra | 卡片右上角的操作区域 | string\|ReactNode | - |
|
| extra | 卡片右上角的操作区域 | string\|ReactNode | - | |
|
||||||
| hoverable | 鼠标移过时可浮起 | boolean | false |
|
| hoverable | 鼠标移过时可浮起 | boolean | false | |
|
||||||
| loading | 当卡片内容还在加载中时,可以用 loading 展示一个占位 | boolean | false |
|
| loading | 当卡片内容还在加载中时,可以用 loading 展示一个占位 | boolean | false | |
|
||||||
| tabList | 页签标题列表 | Array<{key: string, tab: ReactNode}> | - |
|
| tabList | 页签标题列表 | Array<{key: string, tab: ReactNode}> | - | |
|
||||||
| size | card 的尺寸 | `default` \| `small` | `default` |
|
| size | card 的尺寸 | `default` \| `small` | `default` | 3.12.0 |
|
||||||
| title | 卡片标题 | string\|ReactNode | - |
|
| title | 卡片标题 | string\|ReactNode | - | |
|
||||||
| type | 卡片类型,可设置为 `inner` 或 不设置 | string | - |
|
| type | 卡片类型,可设置为 `inner` 或 不设置 | string | - | |
|
||||||
| onTabChange | 页签切换的回调 | (key) => void | - |
|
| onTabChange | 页签切换的回调 | (key) => void | - | |
|
||||||
|
|
||||||
### Card.Grid
|
### Card.Grid
|
||||||
|
|
||||||
| Property | Description | Type | Default |
|
| Property | Description | Type | Default | 版本 |
|
||||||
| --------- | ---------------------- | ------ | ------- |
|
| --------- | ---------------------- | ------ | ------- | ---- |
|
||||||
| className | 网格容器类名 | string | - |
|
| className | 网格容器类名 | string | - | |
|
||||||
| style | 定义网格容器类名的样式 | object | - |
|
| style | 定义网格容器类名的样式 | object | - | |
|
||||||
|
|
||||||
### Card.Meta
|
### Card.Meta
|
||||||
|
|
||||||
| Property | Description | Type | Default |
|
| Property | Description | Type | Default | 版本 |
|
||||||
| ----------- | ------------------ | --------- | ------- |
|
| ----------- | ------------------ | --------- | ------- | ---- |
|
||||||
| avatar | 头像/图标 | ReactNode | - |
|
| avatar | 头像/图标 | ReactNode | - | |
|
||||||
| className | 容器类名 | string | - |
|
| className | 容器类名 | string | - | |
|
||||||
| description | 描述内容 | ReactNode | - |
|
| description | 描述内容 | ReactNode | - | |
|
||||||
| style | 定义容器类名的样式 | object | - |
|
| style | 定义容器类名的样式 | object | - | |
|
||||||
| title | 标题内容 | ReactNode | - |
|
| title | 标题内容 | ReactNode | - | |
|
||||||
|
@ -26,10 +26,10 @@ A carousel component. Scales with its container.
|
|||||||
|
|
||||||
## Methods
|
## Methods
|
||||||
|
|
||||||
| Name | Description |
|
| Name | Description | Version |
|
||||||
| --- | --- |
|
| --- | --- | --- |
|
||||||
| goTo(slideNumber, dontAnimate) | Go to slide index, if dontAnimate=true, it happens without animation |
|
| goTo(slideNumber, dontAnimate) | Go to slide index, if dontAnimate=true, it happens without animation | 3.9.3 |
|
||||||
| next() | Change current slide to next slide |
|
| next() | Change current slide to next slide | |
|
||||||
| prev() | Change current slide to previous slide |
|
| prev() | Change current slide to previous slide | |
|
||||||
|
|
||||||
For more info on the parameters, refer to the <https://github.com/akiran/react-slick>
|
For more info on the parameters, refer to the <https://github.com/akiran/react-slick>
|
||||||
|
@ -17,20 +17,20 @@ subtitle: 走马灯
|
|||||||
|
|
||||||
| 参数 | 说明 | 类型 | 默认值 | 版本 |
|
| 参数 | 说明 | 类型 | 默认值 | 版本 |
|
||||||
| --- | --- | --- | --- | --- |
|
| --- | --- | --- | --- | --- |
|
||||||
| afterChange | 切换面板的回调 | function(current) | 无 | |
|
| afterChange | 切换面板的回调 | function(current) | 无 | | |
|
||||||
| autoplay | 是否自动切换 | boolean | false | |
|
| autoplay | 是否自动切换 | boolean | false | | |
|
||||||
| beforeChange | 切换面板的回调 | function(from, to) | 无 | |
|
| beforeChange | 切换面板的回调 | function(from, to) | 无 | | |
|
||||||
| dotPosition | 面板指示点位置,可选 `top` `bottom` `left` `right` | string | bottom | 3.17.0 |
|
| dotPosition | 面板指示点位置,可选 `top` `bottom` `left` `right` | string | bottom | 3.17.0 | 3.17.0 |
|
||||||
| dots | 是否显示面板指示点 | boolean | true | |
|
| dots | 是否显示面板指示点 | boolean | true | | |
|
||||||
| easing | 动画效果 | string | linear | |
|
| easing | 动画效果 | string | linear | | |
|
||||||
| effect | 动画效果函数,可取 scrollx, fade | string | scrollx | |
|
| effect | 动画效果函数,可取 scrollx, fade | string | scrollx | | |
|
||||||
|
|
||||||
## 方法
|
## 方法
|
||||||
|
|
||||||
| 名称 | 描述 |
|
| 名称 | 描述 |
|
||||||
| ------------------------------ | ------------------------------------------------- |
|
| ------------------------------ | ------------------------------------------------- |
|
||||||
| goTo(slideNumber, dontAnimate) | 切换到指定面板, dontAnimate = true 时,不使用动画 |
|
| goTo(slideNumber, dontAnimate) | 切换到指定面板, dontAnimate = true 时,不使用动画 | 3.9.3 |
|
||||||
| next() | 切换到下一面板 |
|
| next() | 切换到下一面板 | |
|
||||||
| prev() | 切换到上一面板 |
|
| prev() | 切换到上一面板 | |
|
||||||
|
|
||||||
更多参数可参考:<https://github.com/akiran/react-slick>
|
更多参数可参考:<https://github.com/akiran/react-slick>
|
||||||
|
@ -18,42 +18,42 @@ Cascade selection box.
|
|||||||
<Cascader options={options} onChange={onChange} />
|
<Cascader options={options} onChange={onChange} />
|
||||||
```
|
```
|
||||||
|
|
||||||
| Property | Description | Type | Default |
|
| Property | Description | Type | Default | Version |
|
||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- | --- |
|
||||||
| allowClear | whether allow clear | boolean | true |
|
| allowClear | whether allow clear | boolean | true | |
|
||||||
| autoFocus | get focus when component mounted | boolean | false |
|
| autoFocus | get focus when component mounted | boolean | false | |
|
||||||
| changeOnSelect | change value on each selection if set to true, see above demo for details | boolean | false |
|
| changeOnSelect | change value on each selection if set to true, see above demo for details | boolean | false | |
|
||||||
| className | additional css class | string | - |
|
| className | additional css class | string | - | |
|
||||||
| defaultValue | initial selected value | string\[] | \[] |
|
| defaultValue | initial selected value | string\[] | \[] | |
|
||||||
| disabled | whether disabled select | boolean | false |
|
| disabled | whether disabled select | boolean | false | |
|
||||||
| displayRender | render function of displaying selected options | `(label, selectedOptions) => ReactNode` | `label => label.join(' / ')` |
|
| displayRender | render function of displaying selected options | `(label, selectedOptions) => ReactNode` | `label => label.join(' / ')` | |
|
||||||
| expandTrigger | expand current item when click or hover, one of 'click' 'hover' | string | 'click' |
|
| expandTrigger | expand current item when click or hover, one of 'click' 'hover' | string | 'click' | |
|
||||||
| fieldNames | custom field name for label and value and children (before 3.7.0 it calls `filedNames` which is typo)) | object | `{ label: 'label', value: 'value', children: 'children' }` |
|
| fieldNames | custom field name for label and value and children (before 3.7.0 it calls `filedNames` which is typo)) | object | `{ label: 'label', value: 'value', children: 'children' }` | 3.7.0 |
|
||||||
| getPopupContainer | Parent Node which the selector should be rendered to. Default to `body`. When position issues happen, try to modify it into scrollable content and position it relative.[example](https://codepen.io/afc163/pen/zEjNOy?editors=0010) | Function(triggerNode) | () => document.body |
|
| getPopupContainer | Parent Node which the selector should be rendered to. Default to `body`. When position issues happen, try to modify it into scrollable content and position it relative.[example](https://codepen.io/afc163/pen/zEjNOy?editors=0010) | Function(triggerNode) | () => document.body | |
|
||||||
| loadData | To load option lazily, and it cannot work with `showSearch` | `(selectedOptions) => void` | - |
|
| loadData | To load option lazily, and it cannot work with `showSearch` | `(selectedOptions) => void` | - | |
|
||||||
| notFoundContent | Specify content to show when no result matches. | string | 'Not Found' |
|
| notFoundContent | Specify content to show when no result matches. | string | 'Not Found' | |
|
||||||
| options | data options of cascade | [Option](#Option)[] | - |
|
| options | data options of cascade | [Option](#Option)[] | - | |
|
||||||
| placeholder | input placeholder | string | 'Please select' |
|
| placeholder | input placeholder | string | 'Please select' | |
|
||||||
| popupClassName | additional className of popup overlay | string | - |
|
| popupClassName | additional className of popup overlay | string | - | |
|
||||||
| popupPlacement | use preset popup align config from builtinPlacements:`bottomLeft` `bottomRight` `topLeft` `topRight` | string | `bottomLeft` |
|
| popupPlacement | use preset popup align config from builtinPlacements:`bottomLeft` `bottomRight` `topLeft` `topRight` | string | `bottomLeft` | |
|
||||||
| popupVisible | set visible of cascader popup | boolean | - |
|
| popupVisible | set visible of cascader popup | boolean | - | |
|
||||||
| showSearch | Whether show search input in single mode. | boolean\|object | false |
|
| showSearch | Whether show search input in single mode. | boolean\|object | false | |
|
||||||
| size | input size, one of `large` `default` `small` | string | `default` |
|
| size | input size, one of `large` `default` `small` | string | `default` | |
|
||||||
| style | additional style | string | - |
|
| style | additional style | string | - | |
|
||||||
| suffixIcon | The custom suffix icon | ReactNode | - |
|
| suffixIcon | The custom suffix icon | ReactNode | - | 3.10.0 |
|
||||||
| value | selected value | string\[] | - |
|
| value | selected value | string\[] | - | |
|
||||||
| onChange | callback when finishing cascader select | `(value, selectedOptions) => void` | - |
|
| onChange | callback when finishing cascader select | `(value, selectedOptions) => void` | - | |
|
||||||
| onPopupVisibleChange | callback when popup shown or hidden | `(value) => void` | - |
|
| onPopupVisibleChange | callback when popup shown or hidden | `(value) => void` | - | |
|
||||||
|
|
||||||
Fields in `showSearch`:
|
Fields in `showSearch`:
|
||||||
|
|
||||||
| Property | Description | Type | Default |
|
| Property | Description | Type | Default | Version |
|
||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- | --- |
|
||||||
| filter | The function will receive two arguments, inputValue and option, if the function returns true, the option will be included in the filtered set; Otherwise, it will be excluded. | `function(inputValue, path): boolean` | |
|
| filter | The function will receive two arguments, inputValue and option, if the function returns true, the option will be included in the filtered set; Otherwise, it will be excluded. | `function(inputValue, path): boolean` | | |
|
||||||
| limit | Set the count of filtered items | number \| false | 50 |
|
| limit | Set the count of filtered items | number \| false | 50 | 3.11.0 |
|
||||||
| matchInputWidth | Whether the width of result list equals to input's | boolean | |
|
| matchInputWidth | Whether the width of result list equals to input's | boolean | | |
|
||||||
| render | Used to render filtered options. | `function(inputValue, path): ReactNode` | |
|
| render | Used to render filtered options. | `function(inputValue, path): ReactNode` | | |
|
||||||
| sort | Used to sort filtered options. | `function(a, b, inputValue)` | |
|
| sort | Used to sort filtered options. | `function(a, b, inputValue)` | | |
|
||||||
|
|
||||||
### Option
|
### Option
|
||||||
|
|
||||||
@ -68,10 +68,10 @@ interface Option {
|
|||||||
|
|
||||||
## Methods
|
## Methods
|
||||||
|
|
||||||
| Name | Description |
|
| Name | Description | Version |
|
||||||
| ------- | ------------ |
|
| ------- | ------------ | ------- |
|
||||||
| blur() | remove focus |
|
| blur() | remove focus | |
|
||||||
| focus() | get focus |
|
| focus() | get focus | |
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
.ant-cascader-picker {
|
.ant-cascader-picker {
|
||||||
|
@ -19,42 +19,42 @@ subtitle: 级联选择
|
|||||||
<Cascader options={options} onChange={onChange} />
|
<Cascader options={options} onChange={onChange} />
|
||||||
```
|
```
|
||||||
|
|
||||||
| 参数 | 说明 | 类型 | 默认值 |
|
| 参数 | 说明 | 类型 | 默认值 | 版本 |
|
||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- | --- |
|
||||||
| allowClear | 是否支持清除 | boolean | true |
|
| allowClear | 是否支持清除 | boolean | true | |
|
||||||
| autoFocus | 自动获取焦点 | boolean | false |
|
| autoFocus | 自动获取焦点 | boolean | false | |
|
||||||
| changeOnSelect | 当此项为 true 时,点选每级菜单选项值都会发生变化,具体见上面的演示 | boolean | false |
|
| changeOnSelect | 当此项为 true 时,点选每级菜单选项值都会发生变化,具体见上面的演示 | boolean | false | |
|
||||||
| className | 自定义类名 | string | - |
|
| className | 自定义类名 | string | - | |
|
||||||
| defaultValue | 默认的选中项 | string\[] | \[] |
|
| defaultValue | 默认的选中项 | string\[] | \[] | |
|
||||||
| disabled | 禁用 | boolean | false |
|
| disabled | 禁用 | boolean | false | |
|
||||||
| displayRender | 选择后展示的渲染函数 | `(label, selectedOptions) => ReactNode` | `label => label.join(' / ')` |
|
| displayRender | 选择后展示的渲染函数 | `(label, selectedOptions) => ReactNode` | `label => label.join(' / ')` | |
|
||||||
| expandTrigger | 次级菜单的展开方式,可选 'click' 和 'hover' | string | 'click' |
|
| expandTrigger | 次级菜单的展开方式,可选 'click' 和 'hover' | string | 'click' | |
|
||||||
| fieldNames | 自定义 options 中 label name children 的字段(注意,3.7.0 之前的版本为 `filedNames`) | object | `{ label: 'label', value: 'value', children: 'children' }` |
|
| fieldNames | 自定义 options 中 label name children 的字段(注意,3.7.0 之前的版本为 `filedNames`) | object | `{ label: 'label', value: 'value', children: 'children' }` | 3.7.0 |
|
||||||
| getPopupContainer | 菜单渲染父节点。默认渲染到 body 上,如果你遇到菜单滚动定位问题,试试修改为滚动的区域,并相对其定位。[示例](https://codepen.io/afc163/pen/zEjNOy?editors=0010) | Function(triggerNode) | () => document.body |
|
| getPopupContainer | 菜单渲染父节点。默认渲染到 body 上,如果你遇到菜单滚动定位问题,试试修改为滚动的区域,并相对其定位。[示例](https://codepen.io/afc163/pen/zEjNOy?editors=0010) | Function(triggerNode) | () => document.body | |
|
||||||
| loadData | 用于动态加载选项,无法与 `showSearch` 一起使用 | `(selectedOptions) => void` | - |
|
| loadData | 用于动态加载选项,无法与 `showSearch` 一起使用 | `(selectedOptions) => void` | - | |
|
||||||
| notFoundContent | 当下拉列表为空时显示的内容 | string | 'Not Found' |
|
| notFoundContent | 当下拉列表为空时显示的内容 | string | 'Not Found' | |
|
||||||
| options | 可选项数据源 | [Option](#Option)[] | - |
|
| options | 可选项数据源 | [Option](#Option)[] | - | |
|
||||||
| placeholder | 输入框占位文本 | string | '请选择' |
|
| placeholder | 输入框占位文本 | string | '请选择' | |
|
||||||
| popupClassName | 自定义浮层类名 | string | - |
|
| popupClassName | 自定义浮层类名 | string | - | |
|
||||||
| popupPlacement | 浮层预设位置:`bottomLeft` `bottomRight` `topLeft` `topRight` | Enum | `bottomLeft` |
|
| popupPlacement | 浮层预设位置:`bottomLeft` `bottomRight` `topLeft` `topRight` | Enum | `bottomLeft` | |
|
||||||
| popupVisible | 控制浮层显隐 | boolean | - |
|
| popupVisible | 控制浮层显隐 | boolean | - | |
|
||||||
| showSearch | 在选择框中显示搜索框 | boolean | false |
|
| showSearch | 在选择框中显示搜索框 | boolean | false | |
|
||||||
| size | 输入框大小,可选 `large` `default` `small` | string | `default` |
|
| size | 输入框大小,可选 `large` `default` `small` | string | `default` | |
|
||||||
| style | 自定义样式 | string | - |
|
| style | 自定义样式 | string | - | |
|
||||||
| suffixIcon | 自定义的选择框后缀图标 | ReactNode | - |
|
| suffixIcon | 自定义的选择框后缀图标 | ReactNode | - | 3.10.0 |
|
||||||
| value | 指定选中项 | string\[] | - |
|
| value | 指定选中项 | string\[] | - | |
|
||||||
| onChange | 选择完成后的回调 | `(value, selectedOptions) => void` | - |
|
| onChange | 选择完成后的回调 | `(value, selectedOptions) => void` | - | |
|
||||||
| onPopupVisibleChange | 显示/隐藏浮层的回调 | `(value) => void` | - |
|
| onPopupVisibleChange | 显示/隐藏浮层的回调 | `(value) => void` | - | |
|
||||||
|
|
||||||
`showSearch` 为对象时,其中的字段:
|
`showSearch` 为对象时,其中的字段:
|
||||||
|
|
||||||
| 参数 | 说明 | 类型 | 默认值 |
|
| 参数 | 说明 | 类型 | 默认值 | 版本 |
|
||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- | --- |
|
||||||
| filter | 接收 `inputValue` `path` 两个参数,当 `path` 符合筛选条件时,应返回 true,反之则返回 false。 | `function(inputValue, path): boolean` | |
|
| filter | 接收 `inputValue` `path` 两个参数,当 `path` 符合筛选条件时,应返回 true,反之则返回 false。 | `function(inputValue, path): boolean` | | |
|
||||||
| limit | 搜索结果展示数量 | number \| false | 50 |
|
| limit | 搜索结果展示数量 | number \| false | 50 | 3.11.0 |
|
||||||
| matchInputWidth | 搜索结果列表是否与输入框同宽 | boolean | |
|
| matchInputWidth | 搜索结果列表是否与输入框同宽 | boolean | | |
|
||||||
| render | 用于渲染 filter 后的选项 | `function(inputValue, path): ReactNode` | |
|
| render | 用于渲染 filter 后的选项 | `function(inputValue, path): ReactNode` | | |
|
||||||
| sort | 用于排序 filter 后的选项 | `function(a, b, inputValue)` | |
|
| sort | 用于排序 filter 后的选项 | `function(a, b, inputValue)` | | |
|
||||||
|
|
||||||
### Option
|
### Option
|
||||||
|
|
||||||
@ -69,10 +69,10 @@ interface Option {
|
|||||||
|
|
||||||
## 方法
|
## 方法
|
||||||
|
|
||||||
| 名称 | 描述 |
|
| 名称 | 描述 | 版本 |
|
||||||
| ------- | -------- |
|
| ------- | -------- | ---- |
|
||||||
| blur() | 移除焦点 |
|
| blur() | 移除焦点 | |
|
||||||
| focus() | 获取焦点 |
|
| focus() | 获取焦点 | |
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
.ant-cascader-picker {
|
.ant-cascader-picker {
|
||||||
|
@ -17,31 +17,31 @@ Checkbox component.
|
|||||||
|
|
||||||
#### Checkbox
|
#### Checkbox
|
||||||
|
|
||||||
| Property | Description | Type | Default |
|
| Property | Description | Type | Default | Version |
|
||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- | --- |
|
||||||
| autoFocus | get focus when component mounted | boolean | false |
|
| autoFocus | get focus when component mounted | boolean | false | 3.6.2 |
|
||||||
| checked | Specifies whether the checkbox is selected. | boolean | false |
|
| checked | Specifies whether the checkbox is selected. | boolean | false | 3.6.2 |
|
||||||
| defaultChecked | Specifies the initial state: whether or not the checkbox is selected. | boolean | false |
|
| defaultChecked | Specifies the initial state: whether or not the checkbox is selected. | boolean | false | 3.6.2 |
|
||||||
| disabled | Disable checkbox | boolean | false |
|
| disabled | Disable checkbox | boolean | false | 3.6.2 |
|
||||||
| indeterminate | indeterminate checked state of checkbox | boolean | false |
|
| indeterminate | indeterminate checked state of checkbox | boolean | false | 3.6.2 |
|
||||||
| onChange | The callback function that is triggered when the state changes. | Function(e:Event) | - |
|
| onChange | The callback function that is triggered when the state changes. | Function(e:Event) | - | 3.6.2 |
|
||||||
|
|
||||||
#### Checkbox Group
|
#### Checkbox Group
|
||||||
|
|
||||||
| Property | Description | Type | Default |
|
| Property | Description | Type | Default | Version |
|
||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- | --- |
|
||||||
| defaultValue | Default selected value | string\[] | \[] |
|
| defaultValue | Default selected value | string\[] | \[] | 3.6.2 |
|
||||||
| disabled | Disable all checkboxes | boolean | false |
|
| disabled | Disable all checkboxes | boolean | false | 3.6.2 |
|
||||||
| name | The `name` property of all `input[type="checkbox"]` children | string | - |
|
| name | The `name` property of all `input[type="checkbox"]` children | string | - | 3.16.0 |
|
||||||
| options | Specifies options | string\[] | \[] |
|
| options | Specifies options | string\[] | \[] | 3.6.2 |
|
||||||
| value | Used for setting the currently selected value. | string\[] | \[] |
|
| value | Used for setting the currently selected value. | string\[] | \[] | 3.6.2 |
|
||||||
| onChange | The callback function that is triggered when the state changes. | Function(checkedValue) | - |
|
| onChange | The callback function that is triggered when the state changes. | Function(checkedValue) | - | 3.6.2 |
|
||||||
|
|
||||||
### Methods
|
### Methods
|
||||||
|
|
||||||
#### Checkbox
|
#### Checkbox
|
||||||
|
|
||||||
| Name | Description |
|
| Name | Description | Version |
|
||||||
| ------- | ------------ |
|
| ------- | ------------ | ------- |
|
||||||
| blur() | remove focus |
|
| blur() | remove focus | 3.6.2 |
|
||||||
| focus() | get focus |
|
| focus() | get focus | 3.6.2 |
|
||||||
|
@ -18,31 +18,31 @@ title: Checkbox
|
|||||||
|
|
||||||
#### Checkbox
|
#### Checkbox
|
||||||
|
|
||||||
| 参数 | 说明 | 类型 | 默认值 |
|
| 参数 | 说明 | 类型 | 默认值 | 版本 |
|
||||||
| -------------- | --------------------------------------- | ----------------- | ------ |
|
| -------------- | --------------------------------------- | ----------------- | ------ | ----- |
|
||||||
| autoFocus | 自动获取焦点 | boolean | false |
|
| autoFocus | 自动获取焦点 | boolean | false | 3.6.2 |
|
||||||
| checked | 指定当前是否选中 | boolean | false |
|
| checked | 指定当前是否选中 | boolean | false | 3.6.2 |
|
||||||
| defaultChecked | 初始是否选中 | boolean | false |
|
| defaultChecked | 初始是否选中 | boolean | false | 3.6.2 |
|
||||||
| disabled | 失效状态 | boolean | false |
|
| disabled | 失效状态 | boolean | false | 3.6.2 |
|
||||||
| indeterminate | 设置 indeterminate 状态,只负责样式控制 | boolean | false |
|
| indeterminate | 设置 indeterminate 状态,只负责样式控制 | boolean | false | 3.6.2 |
|
||||||
| onChange | 变化时回调函数 | Function(e:Event) | - |
|
| onChange | 变化时回调函数 | Function(e:Event) | - | 3.6.2 |
|
||||||
|
|
||||||
#### Checkbox Group
|
#### Checkbox Group
|
||||||
|
|
||||||
| 参数 | 说明 | 类型 | 默认值 |
|
| 参数 | 说明 | 类型 | 默认值 | 版本 |
|
||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- | --- |
|
||||||
| defaultValue | 默认选中的选项 | string\[] | \[] |
|
| defaultValue | 默认选中的选项 | string\[] | \[] | 3.6.2 |
|
||||||
| disabled | 整组失效 | boolean | false |
|
| disabled | 整组失效 | boolean | false | 3.6.2 |
|
||||||
| name | CheckboxGroup 下所有 `input[type="checkbox"]` 的 `name` 属性 | string | - |
|
| name | CheckboxGroup 下所有 `input[type="checkbox"]` 的 `name` 属性 | string | - | 3.16.0 |
|
||||||
| options | 指定可选项 | string\[] | \[] |
|
| options | 指定可选项 | string\[] | \[] | 3.6.2 |
|
||||||
| value | 指定选中的选项 | string\[] | \[] |
|
| value | 指定选中的选项 | string\[] | \[] | 3.6.2 |
|
||||||
| onChange | 变化时回调函数 | Function(checkedValue) | - |
|
| onChange | 变化时回调函数 | Function(checkedValue) | - | 3.6.2 |
|
||||||
|
|
||||||
### 方法
|
### 方法
|
||||||
|
|
||||||
#### Checkbox
|
#### Checkbox
|
||||||
|
|
||||||
| 名称 | 描述 |
|
| 名称 | 描述 | 版本 |
|
||||||
| ------- | -------- |
|
| ------- | -------- | ----- |
|
||||||
| blur() | 移除焦点 |
|
| blur() | 移除焦点 | 3.6.2 |
|
||||||
| focus() | 获取焦点 |
|
| focus() | 获取焦点 | 3.6.2 |
|
||||||
|
@ -20,20 +20,20 @@ A content area which can be collapsed and expanded.
|
|||||||
| --- | --- | --- | --- | --- |
|
| --- | --- | --- | --- | --- |
|
||||||
| activeKey | Key of the active panel | string\[]\|string | No default value. In `accordion` mode, it's the key of the first panel. | |
|
| activeKey | Key of the active panel | string\[]\|string | No default value. In `accordion` mode, it's the key of the first panel. | |
|
||||||
| defaultActiveKey | Key of the initial active panel | string | - | |
|
| defaultActiveKey | Key of the initial active panel | string | - | |
|
||||||
| bordered | Toggles rendering of the border around the collapse block | boolean | `true` | |
|
| bordered | Toggles rendering of the border around the collapse block | boolean | `true` | 3.6.5 |
|
||||||
| accordion | If `true`, `Collapse` renders as `Accordion` | boolean | `false` | |
|
| accordion | If `true`, `Collapse` renders as `Accordion` | boolean | `false` | 3.6.5 |
|
||||||
| onChange | Callback function executed when active panel is changed | Function | - | |
|
| onChange | Callback function executed when active panel is changed | Function | - | |
|
||||||
| expandIcon | allow to customize collapse icon | (panelProps) => ReactNode | - | |
|
| expandIcon | allow to customize collapse icon | (panelProps) => ReactNode | - | 3.13.0 |
|
||||||
| expandIconPosition | Set expand icon position: `left`, `right` | `left` | - | 3.17.0 |
|
| expandIconPosition | Set expand icon position: `left`, `right` | `left` | - | 3.17.0 |
|
||||||
| destroyInactivePanel | Destroy Inactive Panel | boolean | `false` | |
|
| destroyInactivePanel | Destroy Inactive Panel | boolean | `false` | 3.6.5 |
|
||||||
|
|
||||||
### Collapse.Panel
|
### Collapse.Panel
|
||||||
|
|
||||||
| Property | Description | Type | Default |
|
| Property | Description | Type | Default | Version |
|
||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- | --- |
|
||||||
| disabled | If `true`, panel cannot be opened or closed | boolean | `false` |
|
| disabled | If `true`, panel cannot be opened or closed | boolean | `false` | |
|
||||||
| forceRender | Forced render of content on panel, instead of lazy rending after clicking on header | boolean | `false` |
|
| forceRender | Forced render of content on panel, instead of lazy rending after clicking on header | boolean | `false` | 3.2.0 |
|
||||||
| header | Title of the panel | string\|ReactNode | - |
|
| header | Title of the panel | string\|ReactNode | - | |
|
||||||
| key | Unique key identifying the panel from among its siblings | string | - |
|
| key | Unique key identifying the panel from among its siblings | string | - | |
|
||||||
| showArrow | If `false`, panel will not show arrow icon | boolean | `true` |
|
| showArrow | If `false`, panel will not show arrow icon | boolean | `true` | 3.1.0 |
|
||||||
| extra | extra element in the corner | ReactNode | - |
|
| extra | extra element in the corner | ReactNode | - | 3.14.0 |
|
||||||
|
@ -21,20 +21,20 @@ cols: 1
|
|||||||
| --- | --- | --- | --- | --- |
|
| --- | --- | --- | --- | --- |
|
||||||
| activeKey | 当前激活 tab 面板的 key | string\[]\|string | 默认无,accordion 模式下默认第一个元素 | |
|
| activeKey | 当前激活 tab 面板的 key | string\[]\|string | 默认无,accordion 模式下默认第一个元素 | |
|
||||||
| defaultActiveKey | 初始化选中面板的 key | string | 无 | |
|
| defaultActiveKey | 初始化选中面板的 key | string | 无 | |
|
||||||
| bordered | 带边框风格的折叠面板 | boolean | `true` | |
|
| bordered | 带边框风格的折叠面板 | boolean | `true` | 3.13.0 |
|
||||||
| accordion | 手风琴模式 | boolean | `false` | |
|
| accordion | 手风琴模式 | boolean | `false` | 3.13.0 |
|
||||||
| onChange | 切换面板的回调 | Function | 无 | |
|
| onChange | 切换面板的回调 | Function | 无 | |
|
||||||
| expandIcon | 自定义切换图标 | (panelProps) => ReactNode | - | |
|
| expandIcon | 自定义切换图标 | (panelProps) => ReactNode | - | 3.13.0 |
|
||||||
| expandIconPosition | 设置图标位置: `left`, `right` | `left` | - | 3.17.0 |
|
| expandIconPosition | 设置图标位置: `left`, `right` | `left` | - | 3.17.0 |
|
||||||
| destroyInactivePanel | 销毁折叠隐藏的面板 | boolean | `false` | |
|
| destroyInactivePanel | 销毁折叠隐藏的面板 | boolean | `false` | 3.13.0 |
|
||||||
|
|
||||||
### Collapse.Panel
|
### Collapse.Panel
|
||||||
|
|
||||||
| 参数 | 说明 | 类型 | 默认值 |
|
| 参数 | 说明 | 类型 | 默认值 | 版本 |
|
||||||
| ----------- | ------------------------------------------ | ----------------- | ------ |
|
| ----------- | ------------------------------------------ | ----------------- | ------ | ------ |
|
||||||
| disabled | 禁用后的面板展开与否将无法通过用户交互改变 | boolean | false |
|
| disabled | 禁用后的面板展开与否将无法通过用户交互改变 | boolean | false | |
|
||||||
| forceRender | 被隐藏时是否渲染 DOM 结构 | boolean | false |
|
| forceRender | 被隐藏时是否渲染 DOM 结构 | boolean | false | 3.2.0 |
|
||||||
| header | 面板头内容 | string\|ReactNode | 无 |
|
| header | 面板头内容 | string\|ReactNode | 无 | |
|
||||||
| key | 对应 activeKey | string | 无 |
|
| key | 对应 activeKey | string | 无 | |
|
||||||
| showArrow | 是否展示当前面板上的箭头 | boolean | `true` |
|
| showArrow | 是否展示当前面板上的箭头 | boolean | `true` | 3.13.0 |
|
||||||
| extra | 自定义渲染每个面板右上角的内容 | ReactNode | - |
|
| extra | 自定义渲染每个面板右上角的内容 | ReactNode | - | 3.14.0 |
|
||||||
|
@ -13,11 +13,11 @@ Comments can be used to enable discussions on an entity such as a page, blog pos
|
|||||||
|
|
||||||
## API
|
## API
|
||||||
|
|
||||||
| Property | Description | Type | Default |
|
| Property | Description | Type | Default | Version |
|
||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- | --- |
|
||||||
| actions | List of action items rendered below the comment content | Array<ReactNode> | - |
|
| actions | List of action items rendered below the comment content | Array<ReactNode> | - | 3.11.0 |
|
||||||
| author | The element to display as the comment author | string\|ReactNode | - |
|
| author | The element to display as the comment author | string\|ReactNode | - | 3.11.0 |
|
||||||
| avatar | The element to display as the comment avatar - generally an antd `Avatar` or src | string\|ReactNode | - |
|
| avatar | The element to display as the comment avatar - generally an antd `Avatar` or src | string\|ReactNode | - | 3.11.0 |
|
||||||
| children | Nested comments should be provided as children of the Comment | ReactNode | - |
|
| children | Nested comments should be provided as children of the Comment | ReactNode | - | 3.11.0 |
|
||||||
| content | The main content of the comment | string\|ReactNode | - |
|
| content | The main content of the comment | string\|ReactNode | - | 3.11.0 |
|
||||||
| datetime | A datetime element containing the time to be displayed | string\|ReactNode | - |
|
| datetime | A datetime element containing the time to be displayed | string\|ReactNode | - | 3.11.0 |
|
||||||
|
@ -14,11 +14,11 @@ cols: 1
|
|||||||
|
|
||||||
## API
|
## API
|
||||||
|
|
||||||
| Property | Description | Type | Default |
|
| Property | Description | Type | Default | Version |
|
||||||
| -------- | ------------------------------------------------------ | ----------------- | ------- |
|
| --- | --- | --- | --- | --- |
|
||||||
| actions | 在评论内容下面呈现的操作项列表 | Array<ReactNode> | - |
|
| actions | 在评论内容下面呈现的操作项列表 | Array<ReactNode> | - | 3.11.0 |
|
||||||
| author | 要显示为注释作者的元素 | string\|ReactNode | - |
|
| author | 要显示为注释作者的元素 | string\|ReactNode | - | 3.11.0 |
|
||||||
| avatar | 要显示为评论头像的元素 - 通常是 antd `Avatar` 或者 src | string\|ReactNode | - |
|
| avatar | 要显示为评论头像的元素 - 通常是 antd `Avatar` 或者 src | string\|ReactNode | - | 3.11.0 |
|
||||||
| children | 嵌套注释应作为注释的子项提供 | ReactNode | - |
|
| children | 嵌套注释应作为注释的子项提供 | ReactNode | - | 3.11.0 |
|
||||||
| content | 评论的主要内容 | string\|ReactNode | - |
|
| content | 评论的主要内容 | string\|ReactNode | - | 3.11.0 |
|
||||||
| datetime | 展示时间描述 | string\|ReactNode | - |
|
| datetime | 展示时间描述 | string\|ReactNode | - | 3.11.0 |
|
||||||
|
@ -35,10 +35,10 @@ Some component use dynamic style to support wave effect. You can config `csp` pr
|
|||||||
|
|
||||||
## API
|
## API
|
||||||
|
|
||||||
| Property | Description | Type | Default |
|
| Property | Description | Type | Default | Version |
|
||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- | --- |
|
||||||
| autoInsertSpaceInButton | Set `false` to remove space between 2 chinese characters on Button | boolean | true |
|
| autoInsertSpaceInButton | Set `false` to remove space between 2 chinese characters on Button | boolean | true | 3.13.0 |
|
||||||
| csp | Set [Content Security Policy](https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP) config | { nonce: string } | - |
|
| csp | Set [Content Security Policy](https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP) config | { nonce: string } | - | 3.13.1 |
|
||||||
| renderEmpty | set empty content of components. Ref [Empty](/components/empty/) | Function(componentName: string): ReactNode | - |
|
| renderEmpty | set empty content of components. Ref [Empty](/components/empty/) | Function(componentName: string): ReactNode | - | 3.12.2 |
|
||||||
| getPopupContainer | to set the container of the popup element. The default is to create a `div` element in `body`. | Function(triggerNode) | `() => document.body` |
|
| getPopupContainer | to set the container of the popup element. The default is to create a `div` element in `body`. | Function(triggerNode) | `() => document.body` | 3.11.0 |
|
||||||
| prefixCls | set prefix class | string | ant |
|
| prefixCls | set prefix class | string | ant | 3.12.0 |
|
||||||
|
@ -36,10 +36,10 @@ return (
|
|||||||
|
|
||||||
## API
|
## API
|
||||||
|
|
||||||
| 参数 | 说明 | 类型 | 默认值 |
|
| 参数 | 说明 | 类型 | 默认值 | 版本 |
|
||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- | --- |
|
||||||
| autoInsertSpaceInButton | 设置为 `false` 时,移除按钮中 2 个汉字之间的空格 | boolean | true |
|
| autoInsertSpaceInButton | 设置为 `false` 时,移除按钮中 2 个汉字之间的空格 | boolean | true | 3.13.0 |
|
||||||
| csp | 设置 [Content Security Policy](https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP) 配置 | { nonce: string } | - |
|
| csp | 设置 [Content Security Policy](https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP) 配置 | { nonce: string } | - | 3.13.1 |
|
||||||
| renderEmpty | 自定义组件空状态。参考 [空状态](/components/empty/) | Function(componentName: string): ReactNode | - |
|
| renderEmpty | 自定义组件空状态。参考 [空状态](/components/empty/) | Function(componentName: string): ReactNode | - | 3.12.2 |
|
||||||
| getPopupContainer | 弹出框(Select, Tooltip, Menu 等等)渲染父节点,默认渲染到 body 上。 | Function(triggerNode) | () => document.body |
|
| getPopupContainer | 弹出框(Select, Tooltip, Menu 等等)渲染父节点,默认渲染到 body 上。 | Function(triggerNode) | () => document.body | 3.11.0 |
|
||||||
| prefixCls | 设置统一样式前缀 | string | ant |
|
| prefixCls | 设置统一样式前缀 | string | ant | 3.12.0 |
|
||||||
|
@ -45,80 +45,80 @@ import 'moment/locale/zh-cn';
|
|||||||
|
|
||||||
The following APIs are shared by DatePicker, MonthPicker, RangePicker, WeekPicker.
|
The following APIs are shared by DatePicker, MonthPicker, RangePicker, WeekPicker.
|
||||||
|
|
||||||
| Property | Description | Type | Default |
|
| Property | Description | Type | Default | Version |
|
||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- | --- |
|
||||||
| allowClear | Whether to show clear button | boolean | true |
|
| allowClear | Whether to show clear button | boolean | true | |
|
||||||
| autoFocus | get focus when component mounted | boolean | false |
|
| autoFocus | get focus when component mounted | boolean | false | |
|
||||||
| className | picker className | string | '' |
|
| className | picker className | string | '' | |
|
||||||
| dateRender | custom rendering function for date cells | function(currentDate: moment, today: moment) => React.ReactNode | - |
|
| dateRender | custom rendering function for date cells | function(currentDate: moment, today: moment) => React.ReactNode | - | |
|
||||||
| disabled | determine whether the DatePicker is disabled | boolean | false |
|
| disabled | determine whether the DatePicker is disabled | boolean | false | |
|
||||||
| disabledDate | specify the date that cannot be selected | (currentDate: moment) => boolean | - |
|
| disabledDate | specify the date that cannot be selected | (currentDate: moment) => boolean | - | |
|
||||||
| dropdownClassName | to customize the className of the popup calendar | string | - |
|
| dropdownClassName | to customize the className of the popup calendar | string | - | 3.3.0 |
|
||||||
| getCalendarContainer | to set the container of the floating layer, while the default is to create a `div` element in `body` | function(trigger) | - |
|
| getCalendarContainer | to set the container of the floating layer, while the default is to create a `div` element in `body` | function(trigger) | - | |
|
||||||
| locale | localization configuration | object | [default](https://github.com/ant-design/ant-design/blob/master/components/date-picker/locale/example.json) |
|
| locale | localization configuration | object | [default](https://github.com/ant-design/ant-design/blob/master/components/date-picker/locale/example.json) | |
|
||||||
| mode | picker panel mode([Cannot select year or month anymore?](/docs/react/faq#When-set-mode-to-DatePicker/RangePicker,-cannot-select-year-or-month-anymore?)) | `time|date|month|year|decade` | 'date' |
|
| mode | picker panel mode([Cannot select year or month anymore?](/docs/react/faq#When-set-mode-to-DatePicker/RangePicker,-cannot-select-year-or-month-anymore?) | `time|date|month|year|decade` | 'date' | |
|
||||||
| open | open state of picker | boolean | - |
|
| open | open state of picker | boolean | - | |
|
||||||
| placeholder | placeholder of date input | string\|RangePicker\[] | - |
|
| placeholder | placeholder of date input | string\|RangePicker\[] | - | |
|
||||||
| popupStyle | to customize the style of the popup calendar | object | {} |
|
| popupStyle | to customize the style of the popup calendar | object | {} | |
|
||||||
| size | determine the size of the input box, the height of `large` and `small`, are 40px and 24px respectively, while default size is 32px | string | - |
|
| size | determine the size of the input box, the height of `large` and `small`, are 40px and 24px respectively, while default size is 32px | string | - | |
|
||||||
| suffixIcon | The custom suffix icon | ReactNode | - |
|
| suffixIcon | The custom suffix icon | ReactNode | - | 3.10.0 |
|
||||||
| style | to customize the style of the input box | object | {} |
|
| style | to customize the style of the input box | object | {} | |
|
||||||
| onOpenChange | a callback function, can be executed whether the popup calendar is popped up or closed | function(status) | - |
|
| onOpenChange | a callback function, can be executed whether the popup calendar is popped up or closed | function(status) | - | |
|
||||||
| onPanelChange | callback when picker panel mode is changed | function(value, mode) | - |
|
| onPanelChange | callback when picker panel mode is changed | function(value, mode) | - | 3.5.0 |
|
||||||
|
|
||||||
### Common Methods
|
### Common Methods
|
||||||
|
|
||||||
| Name | Description |
|
| Name | Description | Version |
|
||||||
| ------- | ------------ |
|
| ------- | ------------ | ------- |
|
||||||
| blur() | remove focus |
|
| blur() | remove focus | |
|
||||||
| focus() | get focus |
|
| focus() | get focus | |
|
||||||
|
|
||||||
### DatePicker
|
### DatePicker
|
||||||
|
|
||||||
| Property | Description | Type | Default |
|
| Property | Description | Type | Default | Version |
|
||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- | --- |
|
||||||
| defaultValue | to set default date, if start time or end time is null or undefined, the date range will be an open interval | [moment](http://momentjs.com/) | - |
|
| defaultValue | to set default date, if start time or end time is null or undefined, the date range will be an open interval | [moment](http://momentjs.com/) | - | |
|
||||||
| defaultPickerValue | to set default picker date | [moment](http://momentjs.com/) | - |
|
| defaultPickerValue | to set default picker date | [moment](http://momentjs.com/) | - | 3.10.8 |
|
||||||
| disabledTime | to specify the time that cannot be selected | function(date) | - |
|
| disabledTime | to specify the time that cannot be selected | function(date) | - | |
|
||||||
| format | to set the date format, refer to [moment.js](http://momentjs.com/). When an array is provided, all values are used for parsing and first value is used for formatting. | string \| string[] | "YYYY-MM-DD" |
|
| format | to set the date format, refer to [moment.js](http://momentjs.com/). When an array is provided, all values are used for parsing and first value is used for formatting. | string \| string[] | "YYYY-MM-DD" | |
|
||||||
| renderExtraFooter | render extra footer in panel | (mode) => React.ReactNode | - |
|
| renderExtraFooter | render extra footer in panel | (mode) => React.ReactNode | - | |
|
||||||
| showTime | to provide an additional time selection | object\|boolean | [TimePicker Options](/components/time-picker/#API) |
|
| showTime | to provide an additional time selection | object\|boolean | [TimePicker Options](/components/time-picker/#API) | |
|
||||||
| showTime.defaultValue | to set default time of selected date, [demo](#components-date-picker-demo-disabled-date) | [moment](http://momentjs.com/) | moment() |
|
| showTime.defaultValue | to set default time of selected date, [demo](#components-date-picker-demo-disabled-date) | [moment](http://momentjs.com/) | moment() | |
|
||||||
| showToday | whether to show "Today" button | boolean | true |
|
| showToday | whether to show "Today" button | boolean | true | |
|
||||||
| value | to set date | [moment](http://momentjs.com/) | - |
|
| value | to set date | [moment](http://momentjs.com/) | - | |
|
||||||
| onChange | a callback function, can be executed when the selected time is changing | function(date: moment, dateString: string) | - |
|
| onChange | a callback function, can be executed when the selected time is changing | function(date: moment, dateString: string) | - | |
|
||||||
| onOk | callback when click ok button | function() | - |
|
| onOk | callback when click ok button | function() | - | |
|
||||||
| onPanelChange | Callback function for panel changing | function(value, mode) | - |
|
| onPanelChange | Callback function for panel changing | function(value, mode) | - | 3.19.8 |
|
||||||
|
|
||||||
### MonthPicker
|
### MonthPicker
|
||||||
|
|
||||||
| Property | Description | Type | Default |
|
| Property | Description | Type | Default | Version |
|
||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- | --- |
|
||||||
| defaultValue | to set default date | [moment](http://momentjs.com/) | - |
|
| defaultValue | to set default date | [moment](http://momentjs.com/) | - | |
|
||||||
| defaultPickerValue | to set default picker date | [moment](http://momentjs.com/) | - |
|
| defaultPickerValue | to set default picker date | [moment](http://momentjs.com/) | - | 3.10.8 |
|
||||||
| format | to set the date format, refer to [moment.js](http://momentjs.com/) | string | "YYYY-MM" |
|
| format | to set the date format, refer to [moment.js](http://momentjs.com/) | string | "YYYY-MM" | |
|
||||||
| monthCellContentRender | Custom month cell content render method | function(date, locale): ReactNode | - |
|
| monthCellContentRender | Custom month cell content render method | function(date, locale): ReactNode | - | |
|
||||||
| renderExtraFooter | render extra footer in panel | () => React.ReactNode | - |
|
| renderExtraFooter | render extra footer in panel | () => React.ReactNode | - | |
|
||||||
| value | to set date | [moment](http://momentjs.com/) | - |
|
| value | to set date | [moment](http://momentjs.com/) | - | |
|
||||||
| onChange | a callback function, can be executed when the selected time is changing | function(date: moment, dateString: string) | - |
|
| onChange | a callback function, can be executed when the selected time is changing | function(date: moment, dateString: string) | - | |
|
||||||
|
|
||||||
### WeekPicker
|
### WeekPicker
|
||||||
|
|
||||||
| Property | Description | Type | Default |
|
| Property | Description | Type | Default | Version |
|
||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- | --- |
|
||||||
| defaultValue | to set default date | [moment](http://momentjs.com/) | - |
|
| defaultValue | to set default date | [moment](http://momentjs.com/) | - | |
|
||||||
| defaultPickerValue | to set default picker date | [moment](http://momentjs.com/) | - |
|
| defaultPickerValue | to set default picker date | [moment](http://momentjs.com/) | - | 3.10.8 |
|
||||||
| format | to set the date format, refer to [moment.js](http://momentjs.com/) | string | "YYYY-wo" |
|
| format | to set the date format, refer to [moment.js](http://momentjs.com/) | string | "YYYY-wo" | |
|
||||||
| value | to set date | [moment](http://momentjs.com/) | - |
|
| value | to set date | [moment](http://momentjs.com/) | - | |
|
||||||
| onChange | a callback function, can be executed when the selected time is changing | function(date: moment, dateString: string) | - |
|
| onChange | a callback function, can be executed when the selected time is changing | function(date: moment, dateString: string) | - | |
|
||||||
| renderExtraFooter | render extra footer in panel | (mode) => React.ReactNode | - |
|
| renderExtraFooter | render extra footer in panel | (mode) => React.ReactNode | - | 3.12.0 |
|
||||||
|
|
||||||
### RangePicker
|
### RangePicker
|
||||||
|
|
||||||
| Property | Description | Type | Default | Version |
|
| Property | Description | Type | Default | Version |
|
||||||
| --- | --- | --- | --- | --- |
|
| --- | --- | --- | --- | --- |
|
||||||
| defaultValue | to set default date | \[[moment](http://momentjs.com/), [moment](http://momentjs.com/)] | - | |
|
| defaultValue | to set default date | \[[moment](http://momentjs.com/), [moment](http://momentjs.com/)] | - | |
|
||||||
| defaultPickerValue | to set default picker date | \[[moment](http://momentjs.com/), [moment](http://momentjs.com/)\] | - | |
|
| defaultPickerValue | to set default picker date | \[[moment](http://momentjs.com/), [moment](http://momentjs.com/)\] | - | 3.10.8 |
|
||||||
| disabledTime | to specify the time that cannot be selected | function(dates: \[moment, moment], partial: `'start'|'end'`) | - | |
|
| disabledTime | to specify the time that cannot be selected | function(dates: \[moment, moment], partial: `'start'|'end'`) | - | |
|
||||||
| format | to set the date format, refer to [moment.js](http://momentjs.com/). When an array is provided, all values are used for parsing and first value is used for formatting. | string \| string[] | "YYYY-MM-DD HH:mm:ss" | |
|
| format | to set the date format, refer to [moment.js](http://momentjs.com/). When an array is provided, all values are used for parsing and first value is used for formatting. | string \| string[] | "YYYY-MM-DD HH:mm:ss" | |
|
||||||
| ranges | preseted ranges for quick selection | { \[range: string]: [moment](http://momentjs.com/)\[] } \| { \[range: string]: () => [moment](http://momentjs.com/)\[] } | - | |
|
| ranges | preseted ranges for quick selection | { \[range: string]: [moment](http://momentjs.com/)\[] } \| { \[range: string]: () => [moment](http://momentjs.com/)\[] } | - | |
|
||||||
@ -127,7 +127,7 @@ The following APIs are shared by DatePicker, MonthPicker, RangePicker, WeekPicke
|
|||||||
| showTime | to provide an additional time selection | object\|boolean | [TimePicker Options](/components/time-picker/#API) | |
|
| showTime | to provide an additional time selection | object\|boolean | [TimePicker Options](/components/time-picker/#API) | |
|
||||||
| showTime.defaultValue | to set default time of selected date, [demo](#components-date-picker-demo-disabled-date) | [moment](http://momentjs.com/)\[] | \[moment(), moment()] | |
|
| showTime.defaultValue | to set default time of selected date, [demo](#components-date-picker-demo-disabled-date) | [moment](http://momentjs.com/)\[] | \[moment(), moment()] | |
|
||||||
| value | to set date | \[[moment](http://momentjs.com/), [moment](http://momentjs.com/)] | - | |
|
| value | to set date | \[[moment](http://momentjs.com/), [moment](http://momentjs.com/)] | - | |
|
||||||
| onCalendarChange | a callback function, can be executed when the start time or the end time of the range is changing | function(dates: \[moment, moment], dateStrings: \[string, string]) | - | |
|
| onCalendarChange | a callback function, can be executed when the start time or the end time of the range is changing | function(dates: \[moment, moment], dateStrings: \[string, string]) | - | 3.10.9 |
|
||||||
| onChange | a callback function, can be executed when the selected time is changing | function(dates: \[moment, moment], dateStrings: \[string, string]) | - | |
|
| onChange | a callback function, can be executed when the selected time is changing | function(dates: \[moment, moment], dateStrings: \[string, string]) | - | |
|
||||||
| onOk | callback when click ok button | function(dates: [moment](http://momentjs.com/)\[]) | - | |
|
| onOk | callback when click ok button | function(dates: [moment](http://momentjs.com/)\[]) | - | |
|
||||||
|
|
||||||
|
@ -47,80 +47,80 @@ moment.locale('zh-cn');
|
|||||||
|
|
||||||
以下 API 为 DatePicker、MonthPicker、RangePicker, WeekPicker 共享的 API。
|
以下 API 为 DatePicker、MonthPicker、RangePicker, WeekPicker 共享的 API。
|
||||||
|
|
||||||
| 参数 | 说明 | 类型 | 默认值 |
|
| 参数 | 说明 | 类型 | 默认值 | 版本 |
|
||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- | --- |
|
||||||
| allowClear | 是否显示清除按钮 | boolean | true |
|
| allowClear | 是否显示清除按钮 | boolean | true | |
|
||||||
| autoFocus | 自动获取焦点 | boolean | false |
|
| autoFocus | 自动获取焦点 | boolean | false | |
|
||||||
| className | 选择器 className | string | '' |
|
| className | 选择器 className | string | '' | |
|
||||||
| dateRender | 自定义日期单元格的内容 | function(currentDate: moment, today: moment) => React.ReactNode | - |
|
| dateRender | 自定义日期单元格的内容 | function(currentDate: moment, today: moment) => React.ReactNode | - | |
|
||||||
| disabled | 禁用 | boolean | false |
|
| disabled | 禁用 | boolean | false | |
|
||||||
| disabledDate | 不可选择的日期 | (currentDate: moment) => boolean | 无 |
|
| disabledDate | 不可选择的日期 | (currentDate: moment) => boolean | 无 | |
|
||||||
| dropdownClassName | 额外的弹出日历 className | string | - |
|
| dropdownClassName | 额外的弹出日历 className | string | - | 3.3.0 |
|
||||||
| getCalendarContainer | 定义浮层的容器,默认为 body 上新建 div | function(trigger) | 无 |
|
| getCalendarContainer | 定义浮层的容器,默认为 body 上新建 div | function(trigger) | 无 | |
|
||||||
| locale | 国际化配置 | object | [默认配置](https://github.com/ant-design/ant-design/blob/master/components/date-picker/locale/example.json) |
|
| locale | 国际化配置 | object | [默认配置](https://github.com/ant-design/ant-design/blob/master/components/date-picker/locale/example.json) | |
|
||||||
| mode | 日期面板的状态([设置后无法选择年份/月份?](/docs/react/faq#当我指定了-DatePicker/RangePicker-的-mode-属性后,点击后无法选择年份/月份?)) | `time|date|month|year|decade` | 'date' |
|
| mode | 日期面板的状态([设置后无法选择年份/月份?](/docs/react/faq#当我指定了-DatePicker/RangePicker-的-mode-属性后,点击后无法选择年份/月份?)) | `time|date|month|year|decade` | 'date' | |
|
||||||
| open | 控制弹层是否展开 | boolean | - |
|
| open | 控制弹层是否展开 | boolean | - | |
|
||||||
| placeholder | 输入框提示文字 | string\|RangePicker\[] | - |
|
| placeholder | 输入框提示文字 | string\|RangePicker\[] | - | |
|
||||||
| popupStyle | 额外的弹出日历样式 | object | {} |
|
| popupStyle | 额外的弹出日历样式 | object | {} | |
|
||||||
| size | 输入框大小,`large` 高度为 40px,`small` 为 24px,默认是 32px | string | 无 |
|
| size | 输入框大小,`large` 高度为 40px,`small` 为 24px,默认是 32px | string | 无 | |
|
||||||
| suffixIcon | 自定义的选择框后缀图标 | ReactNode | - |
|
| suffixIcon | 自定义的选择框后缀图标 | ReactNode | - | 3.10.0 |
|
||||||
| style | 自定义输入框样式 | object | {} |
|
| style | 自定义输入框样式 | object | {} | |
|
||||||
| onOpenChange | 弹出日历和关闭日历的回调 | function(status) | 无 |
|
| onOpenChange | 弹出日历和关闭日历的回调 | function(status) | 无 | |
|
||||||
| onPanelChange | 日历面板切换的回调 | function(value, mode) | - |
|
| onPanelChange | 日历面板切换的回调 | function(value, mode) | - | 3.12.0 |
|
||||||
|
|
||||||
### 共同的方法
|
### 共同的方法
|
||||||
|
|
||||||
| 名称 | 描述 |
|
| 名称 | 描述 | 版本 |
|
||||||
| ------- | -------- |
|
| ------- | -------- | ---- |
|
||||||
| blur() | 移除焦点 |
|
| blur() | 移除焦点 | |
|
||||||
| focus() | 获取焦点 |
|
| focus() | 获取焦点 | |
|
||||||
|
|
||||||
### DatePicker
|
### DatePicker
|
||||||
|
|
||||||
| 参数 | 说明 | 类型 | 默认值 |
|
| 参数 | 说明 | 类型 | 默认值 | 版本 |
|
||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- | --- |
|
||||||
| defaultValue | 默认日期,如果开始时间或结束时间为 `null` 或者 `undefined`,日期范围将是一个开区间 | [moment](http://momentjs.com/) | 无 |
|
| defaultValue | 默认日期,如果开始时间或结束时间为 `null` 或者 `undefined`,日期范围将是一个开区间 | [moment](http://momentjs.com/) | 无 | |
|
||||||
| defaultPickerValue | 默认面板日期 | [moment](http://momentjs.com/) | 无 |
|
| defaultPickerValue | 默认面板日期 | [moment](http://momentjs.com/) | 无 | 3.10.8 |
|
||||||
| disabledTime | 不可选择的时间 | function(date) | 无 |
|
| disabledTime | 不可选择的时间 | function(date) | 无 | |
|
||||||
| format | 设置日期格式,为数组时支持多格式匹配,展示以第一个为准。配置参考 [moment.js](http://momentjs.com/) | string \| string[] | "YYYY-MM-DD" |
|
| format | 设置日期格式,为数组时支持多格式匹配,展示以第一个为准。配置参考 [moment.js](http://momentjs.com/) | string \| string[] | "YYYY-MM-DD" | |
|
||||||
| renderExtraFooter | 在面板中添加额外的页脚 | (mode) => React.ReactNode | - |
|
| renderExtraFooter | 在面板中添加额外的页脚 | (mode) => React.ReactNode | - | |
|
||||||
| showTime | 增加时间选择功能 | Object\|boolean | [TimePicker Options](/components/time-picker/#API) |
|
| showTime | 增加时间选择功能 | Object\|boolean | [TimePicker Options](/components/time-picker/#API) | |
|
||||||
| showTime.defaultValue | 设置用户选择日期时默认的时分秒,[例子](#components-date-picker-demo-disabled-date) | [moment](http://momentjs.com/) | moment() |
|
| showTime.defaultValue | 设置用户选择日期时默认的时分秒,[例子](#components-date-picker-demo-disabled-date) | [moment](http://momentjs.com/) | moment() | |
|
||||||
| showToday | 是否展示“今天”按钮 | boolean | true |
|
| showToday | 是否展示“今天”按钮 | boolean | true | |
|
||||||
| value | 日期 | [moment](http://momentjs.com/) | 无 |
|
| value | 日期 | [moment](http://momentjs.com/) | 无 | |
|
||||||
| onChange | 时间发生变化的回调 | function(date: moment, dateString: string) | 无 |
|
| onChange | 时间发生变化的回调 | function(date: moment, dateString: string) | 无 | |
|
||||||
| onOk | 点击确定按钮的回调 | function() | - |
|
| onOk | 点击确定按钮的回调 | function() | - | |
|
||||||
| onPanelChange | 日期面板变化时的回调 | function(value, mode) | - |
|
| onPanelChange | 日期面板变化时的回调 | function(value, mode) | - | 3.5.0 |
|
||||||
|
|
||||||
### MonthPicker
|
### MonthPicker
|
||||||
|
|
||||||
| 参数 | 说明 | 类型 | 默认值 |
|
| 参数 | 说明 | 类型 | 默认值 | 版本 |
|
||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- | --- |
|
||||||
| defaultValue | 默认日期 | [moment](http://momentjs.com/) | 无 |
|
| defaultValue | 默认日期 | [moment](http://momentjs.com/) | 无 | |
|
||||||
| defaultPickerValue | 默认面板日期 | [moment](http://momentjs.com/) | 无 |
|
| defaultPickerValue | 默认面板日期 | [moment](http://momentjs.com/) | 无 | 3.10.8 |
|
||||||
| format | 展示的日期格式,配置参考 [moment.js](http://momentjs.com/) | string | "YYYY-MM" |
|
| format | 展示的日期格式,配置参考 [moment.js](http://momentjs.com/) | string | "YYYY-MM" | |
|
||||||
| monthCellContentRender | 自定义的月份内容渲染方法 | function(date, locale): ReactNode | - |
|
| monthCellContentRender | 自定义的月份内容渲染方法 | function(date, locale): ReactNode | - | |
|
||||||
| renderExtraFooter | 在面板中添加额外的页脚 | () => React.ReactNode | - |
|
| renderExtraFooter | 在面板中添加额外的页脚 | () => React.ReactNode | - | |
|
||||||
| value | 日期 | [moment](http://momentjs.com/) | 无 |
|
| value | 日期 | [moment](http://momentjs.com/) | 无 | |
|
||||||
| onChange | 时间发生变化的回调,发生在用户选择时间时 | function(date: moment, dateString: string) | - |
|
| onChange | 时间发生变化的回调,发生在用户选择时间时 | function(date: moment, dateString: string) | - | |
|
||||||
|
|
||||||
### WeekPicker
|
### WeekPicker
|
||||||
|
|
||||||
| 参数 | 说明 | 类型 | 默认值 |
|
| 参数 | 说明 | 类型 | 默认值 | 版本 |
|
||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- | --- |
|
||||||
| defaultValue | 默认日期 | [moment](http://momentjs.com/) | - |
|
| defaultValue | 默认日期 | [moment](http://momentjs.com/) | - | |
|
||||||
| defaultPickerValue | 默认面板日期 | [moment](http://momentjs.com/) | 无 |
|
| defaultPickerValue | 默认面板日期 | [moment](http://momentjs.com/) | 无 | 3.10.8 |
|
||||||
| format | 展示的日期格式,配置参考 [moment.js](http://momentjs.com/) | string | "YYYY-wo" |
|
| format | 展示的日期格式,配置参考 [moment.js](http://momentjs.com/) | string | "YYYY-wo" | |
|
||||||
| value | 日期 | [moment](http://momentjs.com/) | - |
|
| value | 日期 | [moment](http://momentjs.com/) | - | |
|
||||||
| onChange | 时间发生变化的回调,发生在用户选择时间时 | function(date: moment, dateString: string) | - |
|
| onChange | 时间发生变化的回调,发生在用户选择时间时 | function(date: moment, dateString: string) | - | |
|
||||||
| renderExtraFooter | 在面板中添加额外的页脚 | (mode) => React.ReactNode | - |
|
| renderExtraFooter | 在面板中添加额外的页脚 | (mode) => React.ReactNode | - | 3.12.0 |
|
||||||
|
|
||||||
### RangePicker
|
### RangePicker
|
||||||
|
|
||||||
| 参数 | 说明 | 类型 | 默认值 | 版本 |
|
| 参数 | 说明 | 类型 | 默认值 | 版本 |
|
||||||
| --- | --- | --- | --- | --- |
|
| --- | --- | --- | --- | --- |
|
||||||
| defaultValue | 默认日期 | [moment](http://momentjs.com/)\[] | 无 | |
|
| defaultValue | 默认日期 | [moment](http://momentjs.com/)\[] | 无 | |
|
||||||
| defaultPickerValue | 默认面板日期 | [moment](http://momentjs.com/)\[] | 无 | |
|
| defaultPickerValue | 默认面板日期 | [moment](http://momentjs.com/)\[] | 无 | 3.10.8 |
|
||||||
| disabledTime | 不可选择的时间 | function(dates: \[moment, moment\], partial: `'start'|'end'`) | 无 | |
|
| disabledTime | 不可选择的时间 | function(dates: \[moment, moment\], partial: `'start'|'end'`) | 无 | |
|
||||||
| format | 展示的日期格式 | string | "YYYY-MM-DD HH:mm:ss" | |
|
| format | 展示的日期格式 | string | "YYYY-MM-DD HH:mm:ss" | |
|
||||||
| ranges | 预设时间范围快捷选择 | { \[range: string]: [moment](http://momentjs.com/)\[] } \| { \[range: string]: () => [moment](http://momentjs.com/)\[] } | 无 | |
|
| ranges | 预设时间范围快捷选择 | { \[range: string]: [moment](http://momentjs.com/)\[] } \| { \[range: string]: () => [moment](http://momentjs.com/)\[] } | 无 | |
|
||||||
|
@ -15,17 +15,17 @@ Commonly displayed on the details page.
|
|||||||
|
|
||||||
### Descriptions
|
### Descriptions
|
||||||
|
|
||||||
| Property | Description | Type | Default |
|
| Property | Description | Type | Default | Version |
|
||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- | --- |
|
||||||
| title | The title of the description list, placed at the top | ReactNode | - |
|
| title | The title of the description list, placed at the top | ReactNode | - | 3.19.0 |
|
||||||
| bordered | whether to display the border | boolean | false |
|
| bordered | whether to display the border | boolean | false | 3.19.0 |
|
||||||
| column | the number of `DescriptionItems` in a row,could be a number or a object like `{ xs: 8, sm: 16, md: 24}`,(Only set `bordered={true}` to take effect) | number | 3 |
|
| column | the number of `DescriptionItems` in a row,could be a number or a object like `{ xs: 8, sm: 16, md: 24}`,(Only set `bordered={true}` to take effect) | number | 3 | 3.19.0 |
|
||||||
| size | set the size of the list. Can be set to `middle`,`small`, or not filled | `default | middle | small` | false |
|
| size | set the size of the list. Can be set to `middle`,`small`, or not filled | `default | middle | small` | false | 3.19.0 |
|
||||||
| layout | Define description layout | `horizontal | vertical` | `horizontal` |
|
| layout | Define description layout | `horizontal | vertical` | `horizontal` | 3.19.8 |
|
||||||
|
|
||||||
### DescriptionItem
|
### DescriptionItem
|
||||||
|
|
||||||
| Property | Description | Type | Default |
|
| Property | Description | Type | Default | Version |
|
||||||
| -------- | ------------------------------ | --------- | ------- |
|
| -------- | ------------------------------ | --------- | ------- | ------- |
|
||||||
| label | description of the content | ReactNode | - |
|
| label | description of the content | ReactNode | - | 3.19.0 |
|
||||||
| span | The number of columns included | number | 1 |
|
| span | The number of columns included | number | 1 | 3.19.0 |
|
||||||
|
@ -16,17 +16,17 @@ cols: 1
|
|||||||
|
|
||||||
### Descriptions
|
### Descriptions
|
||||||
|
|
||||||
| 参数 | 说明 | 类型 | 默认值 |
|
| 参数 | 说明 | 类型 | 默认值 | 版本 |
|
||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- | --- |
|
||||||
| title | 描述列表的标题,显示在最顶部 | ReactNode | - |
|
| title | 描述列表的标题,显示在最顶部 | ReactNode | - | 3.19.0 |
|
||||||
| bordered | 是否展示边框 | boolean | false |
|
| bordered | 是否展示边框 | boolean | false | 3.19.0 |
|
||||||
| column | 一行的 `DescriptionItems` 数量,可以写成像素值或支持响应式的对象写法 `{ xs: 8, sm: 16, md: 24}` | number | 3 |
|
| column | 一行的 `DescriptionItems` 数量,可以写成像素值或支持响应式的对象写法 `{ xs: 8, sm: 16, md: 24}` | number | 3 | 3.19.0 |
|
||||||
| size | 设置列表的大小。可以设置为 `middle` 、`small`, 或不填(只有设置 `bordered={true}` 生效) | `default | middle | small` | false |
|
| size | 设置列表的大小。可以设置为 `middle` 、`small`, 或不填(只有设置 `bordered={true}` 生效) | `default | middle | small` | false | 3.19.0 |
|
||||||
| layout | 描述布局 | `horizontal | vertical` | `horizontal` |
|
| layout | 描述布局 | `horizontal | vertical` | `horizontal` | 3.19.8 |
|
||||||
|
|
||||||
### DescriptionItem
|
### DescriptionItem
|
||||||
|
|
||||||
| 参数 | 说明 | 类型 | 默认值 |
|
| 参数 | 说明 | 类型 | 默认值 | 版本 |
|
||||||
| ----- | ------------ | --------- | ------ |
|
| ----- | ------------ | --------- | ------ | ------ |
|
||||||
| label | 内容的描述 | ReactNode | - |
|
| label | 内容的描述 | ReactNode | - | 3.19.0 |
|
||||||
| span | 包含列的数量 | number | 1 |
|
| span | 包含列的数量 | number | 1 | 3.19.0 |
|
||||||
|
@ -16,10 +16,10 @@ A divider line separates different content.
|
|||||||
|
|
||||||
### Divider
|
### Divider
|
||||||
|
|
||||||
| Property | Description | Type | Default |
|
| Property | Description | Type | Default | Version |
|
||||||
| ----------- | -------------------------------- | ----------------------------- | ------------ |
|
| --- | --- | --- | --- | --- |
|
||||||
| className | className of container | string | - |
|
| className | className of container | string | - | 3.5.4 |
|
||||||
| dashed | whether line is dashed | boolean | false |
|
| dashed | whether line is dashed | boolean | false | |
|
||||||
| orientation | position of title inside divider | enum: `left` `right` `center` | `center` |
|
| orientation | position of title inside divider | enum: `left` `right` `center` | `center` | 3.3.0 |
|
||||||
| style | style object of container | object | - |
|
| style | style object of container | object | - | 3.5.4 |
|
||||||
| type | direction type of divider | enum: `horizontal` `vertical` | `horizontal` |
|
| type | direction type of divider | enum: `horizontal` `vertical` | `horizontal` | |
|
||||||
|
@ -14,10 +14,10 @@ subtitle: 分割线
|
|||||||
|
|
||||||
## API
|
## API
|
||||||
|
|
||||||
| 参数 | 说明 | 类型 | 默认值 |
|
| 参数 | 说明 | 类型 | 默认值 | 版本 |
|
||||||
| ----------- | ---------------- | ----------------------------- | ------------ |
|
| ----------- | ---------------- | ----------------------------- | ------------ | ----- |
|
||||||
| className | 分割线样式类 | string | - |
|
| className | 分割线样式类 | string | - | 3.5.4 |
|
||||||
| dashed | 是否虚线 | boolean | false |
|
| dashed | 是否虚线 | boolean | false | |
|
||||||
| orientation | 分割线标题的位置 | enum: `left` `right` | `center` |
|
| orientation | 分割线标题的位置 | enum: `left` `right` | `center` | 3.4.1 |
|
||||||
| style | 分割线样式对象 | object | - |
|
| style | 分割线样式对象 | object | - | 3.5.4 |
|
||||||
| type | 水平还是垂直类型 | enum: `horizontal` `vertical` | `horizontal` |
|
| type | 水平还是垂直类型 | enum: `horizontal` `vertical` | `horizontal` | |
|
||||||
|
@ -17,26 +17,26 @@ A Drawer is a panel that is typically overlaid on top of a page and slides in fr
|
|||||||
|
|
||||||
## API
|
## API
|
||||||
|
|
||||||
| Props | Description | Type | Default |
|
| Props | Description | Type | Default | Version |
|
||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- | --- |
|
||||||
| closable | Whether a close (x) button is visible on top right of the Drawer dialog or not. | boolean | true |
|
| closable | Whether a close (x) button is visible on top right of the Drawer dialog or not. | boolean | true | 3.7.0 |
|
||||||
| destroyOnClose | Whether to unmount child components on closing drawer or not. | boolean | false |
|
| destroyOnClose | Whether to unmount child components on closing drawer or not. | boolean | false | 3.7.0 |
|
||||||
| getContainer | Return the mounted node for Drawer. | HTMLElement \| `() => HTMLElement` \| Selectors | 'body' |
|
| getContainer | Return the mounted node for Drawer. | HTMLElement \| `() => HTMLElement` \| Selectors | 'body' | 3.7.0 |
|
||||||
| mask | Whether to show mask or not. | Boolean | true |
|
| mask | Whether to show mask or not. | Boolean | true | 3.7.0 |
|
||||||
| maskClosable | Clicking on the mask (area outside the Drawer) to close the Drawer or not. | boolean | true |
|
| maskClosable | Clicking on the mask (area outside the Drawer) to close the Drawer or not. | boolean | true | 3.7.0 |
|
||||||
| maskStyle | Style for Drawer's mask element. | object | {} |
|
| maskStyle | Style for Drawer's mask element. | object | {} | 3.7.0 |
|
||||||
| style | Style of drawer wrapper | object | - |
|
| style | Style of drawer wrapper | object | - | 3.7.0 |
|
||||||
| bodyStyle | Style of floating layer, typically used for adjusting its position. | object | - |
|
| bodyStyle | Style of floating layer, typically used for adjusting its position. | object | - | 3.12.0 |
|
||||||
| title | The title for Drawer. | string\|ReactNode | - |
|
| title | The title for Drawer. | string\|ReactNode | - | 3.7.0 |
|
||||||
| visible | Whether the Drawer dialog is visible or not. | boolean | false |
|
| visible | Whether the Drawer dialog is visible or not. | boolean | false | 3.7.0 |
|
||||||
| width | Width of the Drawer dialog. | string\|number | 256 |
|
| width | Width of the Drawer dialog. | string\|number | 256 | 3.7.0 |
|
||||||
| height | placement is `top` or `bottom`, height of the Drawer dialog. | string\|number | - |
|
| height | placement is `top` or `bottom`, height of the Drawer dialog. | string\|number | - | 3.9.0 |
|
||||||
| className | The class name of the container of the Drawer dialog. | string | - |
|
| className | The class name of the container of the Drawer dialog. | string | - | 3.8.0 |
|
||||||
| zIndex | The `z-index` of the Drawer. | Number | 1000 |
|
| zIndex | The `z-index` of the Drawer. | Number | 1000 | 3.7.0 |
|
||||||
| placement | The placement of the Drawer. | 'top' \| 'right' \| 'bottom' \| 'left' | 'right' |
|
| placement | The placement of the Drawer. | 'top' \| 'right' \| 'bottom' \| 'left' | 'right' | 3.7.0 |
|
||||||
| onClose | Specify a callback that will be called when a user clicks mask, close button or Cancel button. | function(e) | - |
|
| onClose | Specify a callback that will be called when a user clicks mask, close button or Cancel button. | function(e) | - | 3.7.0 |
|
||||||
| afterVisibleChange | Callback after the animation ends when switching drawers. | function(visible) | - |
|
| afterVisibleChange | Callback after the animation ends when switching drawers. | function(visible) | - | 3.17.0 |
|
||||||
| keyboard | Whether support press esc to close | Boolean | true |
|
| keyboard | Whether support press esc to close | Boolean | true | 3.19.8 |
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
#_hj_feedback_container {
|
#_hj_feedback_container {
|
||||||
|
@ -16,26 +16,26 @@ title: Drawer
|
|||||||
|
|
||||||
## API
|
## API
|
||||||
|
|
||||||
| 参数 | 说明 | 类型 | 默认值 |
|
| 参数 | 说明 | 类型 | 默认值 | 版本 |
|
||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- | --- |
|
||||||
| closable | 是否显示右上角的关闭按钮 | boolean | true |
|
| closable | 是否显示右上角的关闭按钮 | boolean | true | 3.7.0 |
|
||||||
| destroyOnClose | 关闭时销毁 Drawer 里的子元素 | boolean | false |
|
| destroyOnClose | 关闭时销毁 Drawer 里的子元素 | boolean | false | 3.7.0 |
|
||||||
| getContainer | 指定 Drawer 挂载的 HTML 节点 | HTMLElement \| `() => HTMLElement` \| Selectors | 'body' |
|
| getContainer | 指定 Drawer 挂载的 HTML 节点 | HTMLElement \| `() => HTMLElement` \| Selectors | 'body' | 3.7.0 |
|
||||||
| maskClosable | 点击蒙层是否允许关闭 | boolean | true |
|
| maskClosable | 点击蒙层是否允许关闭 | boolean | true | 3.7.0 | 3.7.0 |
|
||||||
| mask | 是否展示遮罩 | Boolean | true |
|
| mask | 是否展示遮罩 | Boolean | true |
|
||||||
| maskStyle | 遮罩样式 | object | {} |
|
| maskStyle | 遮罩样式 | object | {} | 3.7.0 |
|
||||||
| style | 可用于设置 Drawer 最外层容器的样式 | object | - |
|
| style | 可用于设置 Drawer 最外层容器的样式 | object | - | 3.7.0 |
|
||||||
| bodyStyle | 可用于设置 Drawer 的样式,调整浮层位置等 | object | - |
|
| bodyStyle | 可用于设置 Drawer 的样式,调整浮层位置等 | object | - | 3.12.0 |
|
||||||
| title | 标题 | string \| ReactNode | - |
|
| title | 标题 | string \| ReactNode | - | 3.7.0 |
|
||||||
| visible | Drawer 是否可见 | boolean | - |
|
| visible | Drawer 是否可见 | boolean | - | 3.7.0 |
|
||||||
| width | 宽度 | string \| number | 256 |
|
| width | 宽度 | string \| number | 256 | 3.7.0 |
|
||||||
| height | 高度, 在 `placement` 为 `top` 或 `bottom` 时使用 | string \| number | 256 |
|
| height | 高度, 在 `placement` 为 `top` 或 `bottom` 时使用 | string \| number | 256 | 3.9.0 |
|
||||||
| className | 对话框外层容器的类名 | string | - |
|
| className | 对话框外层容器的类名 | string | - | 3.8.0 |
|
||||||
| zIndex | 设置 Drawer 的 `z-index` | Number | 1000 |
|
| zIndex | 设置 Drawer 的 `z-index` | Number | 1000 | 3.7.0 |
|
||||||
| placement | 抽屉的方向 | 'top' \| 'right' \| 'bottom' \| 'left' | 'right' |
|
| placement | 抽屉的方向 | 'top' \| 'right' \| 'bottom' \| 'left' | 'right' | 3.7.0 |
|
||||||
| onClose | 点击遮罩层或右上角叉或取消按钮的回调 | function(e) | 无 |
|
| onClose | 点击遮罩层或右上角叉或取消按钮的回调 | function(e) | 无 | 3.7.0 |
|
||||||
| afterVisibleChange | 切换抽屉时动画结束后的回调 | function(visible) | 无 |
|
| afterVisibleChange | 切换抽屉时动画结束后的回调 | function(visible) | 无 | 3.17.0 |
|
||||||
| keyboard | 是否支持键盘 esc 关闭 | boolean | true |
|
| keyboard | 是否支持键盘 esc 关闭 | boolean | true | 3.19.8 |
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
#_hj_feedback_container {
|
#_hj_feedback_container {
|
||||||
|
@ -14,17 +14,17 @@ If there are too many operations to display, you can wrap them in a `Dropdown`.
|
|||||||
|
|
||||||
### Dropdown
|
### Dropdown
|
||||||
|
|
||||||
| Property | Description | Type | Default |
|
| Property | Description | Type | Default | Version |
|
||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- | --- |
|
||||||
| disabled | whether the dropdown menu is disabled | boolean | - |
|
| disabled | whether the dropdown menu is disabled | boolean | - | |
|
||||||
| getPopupContainer | to set the container of the dropdown menu. The default is to create a `div` element in `body`, you can reset it to the scrolling area and make a relative reposition. [example](https://codepen.io/afc163/pen/zEjNOy?editors=0010) | Function(triggerNode) | `() => document.body` |
|
| getPopupContainer | to set the container of the dropdown menu. The default is to create a `div` element in `body`, you can reset it to the scrolling area and make a relative reposition. [example](https://codepen.io/afc163/pen/zEjNOy?editors=0010) | Function(triggerNode) | `() => document.body` | |
|
||||||
| overlay | the dropdown menu | [Menu](/components/menu) \| () => Menu | - |
|
| overlay | the dropdown menu | [Menu](/components/menu) \| () => Menu | - | |
|
||||||
| overlayClassName | Class name of the dropdown root element | string | - |
|
| overlayClassName | Class name of the dropdown root element | string | - | 3.11.0 |
|
||||||
| overlayStyle | Style of the dropdown root element | object | - |
|
| overlayStyle | Style of the dropdown root element | object | - | 3.11.0 |
|
||||||
| placement | placement of pop menu: `bottomLeft` `bottomCenter` `bottomRight` `topLeft` `topCenter` `topRight` | String | `bottomLeft` |
|
| placement | placement of pop menu: `bottomLeft` `bottomCenter` `bottomRight` `topLeft` `topCenter` `topRight` | String | `bottomLeft` | |
|
||||||
| trigger | the trigger mode which executes the drop-down action, hover doesn't work on mobile device | Array<`click`\|`hover`\|`contextMenu`> | `['hover']` |
|
| trigger | the trigger mode which executes the drop-down action, hover doesn't work on mobile device | Array<`click`\|`hover`\|`contextMenu`> | `['hover']` | |
|
||||||
| visible | whether the dropdown menu is visible | boolean | - |
|
| visible | whether the dropdown menu is visible | boolean | - | |
|
||||||
| onVisibleChange | a callback function takes an argument: `visible`, is executed when the visible state is changed | Function(visible) | - |
|
| onVisibleChange | a callback function takes an argument: `visible`, is executed when the visible state is changed | Function(visible) | - | |
|
||||||
|
|
||||||
You should use [Menu](/components/menu/) as `overlay`. The menu items and dividers are also available by using `Menu.Item` and `Menu.Divider`.
|
You should use [Menu](/components/menu/) as `overlay`. The menu items and dividers are also available by using `Menu.Item` and `Menu.Divider`.
|
||||||
|
|
||||||
|
@ -15,17 +15,17 @@ title: Dropdown
|
|||||||
|
|
||||||
属性如下
|
属性如下
|
||||||
|
|
||||||
| 参数 | 说明 | 类型 | 默认值 |
|
| 参数 | 说明 | 类型 | 默认值 | 版本 |
|
||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- | --- |
|
||||||
| disabled | 菜单是否禁用 | boolean | - |
|
| disabled | 菜单是否禁用 | boolean | - | |
|
||||||
| getPopupContainer | 菜单渲染父节点。默认渲染到 body 上,如果你遇到菜单滚动定位问题,试试修改为滚动的区域,并相对其定位。[示例](https://codepen.io/afc163/pen/zEjNOy?editors=0010) | Function(triggerNode) | `() => document.body` |
|
| getPopupContainer | 菜单渲染父节点。默认渲染到 body 上,如果你遇到菜单滚动定位问题,试试修改为滚动的区域,并相对其定位。[示例](https://codepen.io/afc163/pen/zEjNOy?editors=0010) | Function(triggerNode) | `() => document.body` | |
|
||||||
| overlay | 菜单 | [Menu](/components/menu) \| () => Menu | - |
|
| overlay | 菜单 | [Menu](/components/menu) \| () => Menu | - | |
|
||||||
| overlayClassName | 下拉根元素的类名称 | string | - |
|
| overlayClassName | 下拉根元素的类名称 | string | - | 3.11.0 |
|
||||||
| overlayStyle | 下拉根元素的样式 | object | - |
|
| overlayStyle | 下拉根元素的样式 | object | - | 3.11.0 |
|
||||||
| placement | 菜单弹出位置:`bottomLeft` `bottomCenter` `bottomRight` `topLeft` `topCenter` `topRight` | String | `bottomLeft` |
|
| placement | 菜单弹出位置:`bottomLeft` `bottomCenter` `bottomRight` `topLeft` `topCenter` `topRight` | String | `bottomLeft` | |
|
||||||
| trigger | 触发下拉的行为, 移动端不支持 hover | Array<`click`\|`hover`\|`contextMenu`> | `['hover']` |
|
| trigger | 触发下拉的行为, 移动端不支持 hover | Array<`click`\|`hover`\|`contextMenu`> | `['hover']` | |
|
||||||
| visible | 菜单是否显示 | boolean | - |
|
| visible | 菜单是否显示 | boolean | - | |
|
||||||
| onVisibleChange | 菜单显示状态改变时调用,参数为 visible | Function(visible) | - |
|
| onVisibleChange | 菜单显示状态改变时调用,参数为 visible | Function(visible) | - | |
|
||||||
|
|
||||||
`overlay` 菜单使用 [Menu](/components/menu/),还包括菜单项 `Menu.Item`,分割线 `Menu.Divider`。
|
`overlay` 菜单使用 [Menu](/components/menu/),还包括菜单项 `Menu.Item`,分割线 `Menu.Divider`。
|
||||||
|
|
||||||
@ -37,7 +37,7 @@ title: Dropdown
|
|||||||
|
|
||||||
| 参数 | 说明 | 类型 | 默认值 | 版本 |
|
| 参数 | 说明 | 类型 | 默认值 | 版本 |
|
||||||
| --- | --- | --- | --- | --- |
|
| --- | --- | --- | --- | --- |
|
||||||
| disabled | 菜单是否禁用 | boolean | - | | |
|
| disabled | 菜单是否禁用 | boolean | - | |
|
||||||
| icon | 右侧的 icon | ReactNode | - | 3.17.0 |
|
| icon | 右侧的 icon | ReactNode | - | 3.17.0 |
|
||||||
| overlay | 菜单 | [Menu](/components/menu/) | - | |
|
| overlay | 菜单 | [Menu](/components/menu/) | - | |
|
||||||
| placement | 菜单弹出位置:`bottomLeft` `bottomCenter` `bottomRight` `topLeft` `topCenter` `topRight` | String | `bottomLeft` | |
|
| placement | 菜单弹出位置:`bottomLeft` `bottomCenter` `bottomRight` `topLeft` `topCenter` `topRight` | String | `bottomLeft` | |
|
||||||
|
@ -20,11 +20,11 @@ Empty state placeholder.
|
|||||||
</Empty>
|
</Empty>
|
||||||
```
|
```
|
||||||
|
|
||||||
| Property | Description | Type | Default |
|
| Property | Description | Type | Default | Version |
|
||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- | --- |
|
||||||
| description | Customize description | string \| ReactNode | - |
|
| description | Customize description | string \| ReactNode | - | 3.12.0 |
|
||||||
| imageStyle | style of image | CSSProperties | - |
|
| imageStyle | style of image | CSSProperties | - | 3.16.0 |
|
||||||
| image | Customize image. Will tread as image url when string provided. | string \| ReactNode | `Empty.PRESENTED_IMAGE_DEFAULT` |
|
| image | Customize image. Will tread as image url when string provided. | string \| ReactNode | `Empty.PRESENTED_IMAGE_DEFAULT` | 3.12.0 |
|
||||||
|
|
||||||
## Built-in images
|
## Built-in images
|
||||||
|
|
||||||
|
@ -21,11 +21,11 @@ cols: 1
|
|||||||
</Empty>
|
</Empty>
|
||||||
```
|
```
|
||||||
|
|
||||||
| 参数 | 说明 | 类型 | 默认值 |
|
| 参数 | 说明 | 类型 | 默认值 | 版本 |
|
||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- | --- |
|
||||||
| description | 自定义描述内容 | string \| ReactNode | - |
|
| description | 自定义描述内容 | string \| ReactNode | - | 3.12.0 |
|
||||||
| imageStyle | 图片样式 | CSSProperties | - |
|
| imageStyle | 图片样式 | CSSProperties | - | 3.16.0 |
|
||||||
| image | 设置显示图片,为 string 时表示自定义图片地址。 | string \| ReactNode | `Empty.PRESENTED_IMAGE_DEFAULT` |
|
| image | 设置显示图片,为 string 时表示自定义图片地址。 | string \| ReactNode | `Empty.PRESENTED_IMAGE_DEFAULT` | 3.12.0 |
|
||||||
|
|
||||||
## 内置图片 (3.16.0 以上版本)
|
## 内置图片 (3.16.0 以上版本)
|
||||||
|
|
||||||
|
@ -34,16 +34,16 @@ A form consists of one or more form fields whose type includes input, textarea,
|
|||||||
|
|
||||||
**more example [rc-form](http://react-component.github.io/form/)**。
|
**more example [rc-form](http://react-component.github.io/form/)**。
|
||||||
|
|
||||||
| Property | Description | Type | Default Value |
|
| Property | Description | Type | Default Value | Version |
|
||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- | --- |
|
||||||
| form | Decorated by `Form.create()` will be automatically set `this.props.form` property | object | n/a |
|
| form | Decorated by `Form.create()` will be automatically set `this.props.form` property | object | n/a | |
|
||||||
| hideRequiredMark | Hide required mark of all form items | Boolean | false |
|
| hideRequiredMark | Hide required mark of all form items | Boolean | false | |
|
||||||
| labelAlign | Label text align | 'left' \| 'right' | 'right' |
|
| labelAlign | Label text align | 'left' \| 'right' | 'right' | 3.15.0 |
|
||||||
| labelCol | (Added in 3.14.0. Previous version can only set on FormItem.) The layout of label. You can set `span` `offset` to something like `{span: 3, offset: 12}` or `sm: {span: 3, offset: 12}` same as with `<Col>` | [object](https://ant.design/components/grid/#Col) | |
|
| labelCol | (Added in 3.14.0. Previous version can only set on FormItem.) The layout of label. You can set `span` `offset` to something like `{span: 3, offset: 12}` or `sm: {span: 3, offset: 12}` same as with `<Col>` | [object](https://ant.design/components/grid/#Col) | | 3.14.0 |
|
||||||
| layout | Define form layout | 'horizontal'\|'vertical'\|'inline' | 'horizontal' |
|
| layout | Define form layout | 'horizontal'\|'vertical'\|'inline' | 'horizontal' | |
|
||||||
| onSubmit | Defines a function will be called if form data validation is successful. | Function(e:Event) | |
|
| onSubmit | Defines a function will be called if form data validation is successful. | Function(e:Event) | | |
|
||||||
| wrapperCol | (Added in 3.14.0. Previous version can only set on FormItem.) The layout for input controls, same as `labelCol` | [object](https://ant.design/components/grid/#Col) | |
|
| wrapperCol | (Added in 3.14.0. Previous version can only set on FormItem.) The layout for input controls, same as `labelCol` | [object](https://ant.design/components/grid/#Col) | | 3.14.0 |
|
||||||
| colon | change default props colon value of Form.Item | boolean | true |
|
| colon | change default props colon value of Form.Item | boolean | true | 3.15.0 |
|
||||||
|
|
||||||
### Form.create(options)
|
### Form.create(options)
|
||||||
|
|
||||||
@ -57,13 +57,13 @@ CustomizedForm = Form.create({})(CustomizedForm);
|
|||||||
|
|
||||||
The following `options` are available:
|
The following `options` are available:
|
||||||
|
|
||||||
| Property | Description | Type |
|
| Property | Description | Type | Version |
|
||||||
| --- | --- | --- |
|
| --- | --- | --- | --- |
|
||||||
| mapPropsToFields | Convert props to field value(e.g. reading the values from Redux store). And you must mark returned fields with [`Form.createFormField`](#Form.createFormField). Please note that the form fields will become controlled components. Properties like errors will not be automatically mapped and need to be manually passed in. | (props) => ({ \[fieldName\]: FormField { value } }) |
|
| mapPropsToFields | Convert props to field value(e.g. reading the values from Redux store). And you must mark returned fields with [`Form.createFormField`](#Form.createFormField). Please note that the form fields will become controlled components. Properties like errors will not be automatically mapped and need to be manually passed in. | (props) => ({ \[fieldName\]: FormField { value } }) | |
|
||||||
| name | Set the id prefix of fields under form | - |
|
| name | Set the id prefix of fields under form | - | 3.12.0 |
|
||||||
| validateMessages | Default validate message. And its format is similar with [newMessages](https://github.com/yiminghe/async-validator/blob/master/src/messages.js)'s returned value | Object { \[nested.path]: String } |
|
| validateMessages | Default validate message. And its format is similar with [newMessages](https://github.com/yiminghe/async-validator/blob/master/src/messages.js)'s returned value | Object { \[nested.path]: String } | |
|
||||||
| onFieldsChange | Specify a function that will be called when the fields (including errors) of a `Form.Item` gets changed. Usage example: saving the field's value to Redux store. | Function(props, changedFields, allFields) |
|
| onFieldsChange | Specify a function that will be called when the fields (including errors) of a `Form.Item` gets changed. Usage example: saving the field's value to Redux store. | Function(props, changedFields, allFields) | |
|
||||||
| onValuesChange | A handler while value of any field is changed | (props, changedValues, allValues) => void |
|
| onValuesChange | A handler while value of any field is changed | (props, changedValues, allValues) => void | |
|
||||||
|
|
||||||
If you want to get `ref` after `Form.create`, you can use `wrappedComponentRef` provided by `rc-form`, [details can be viewed here](https://github.com/react-component/form#note-use-wrappedcomponentref-instead-of-withref-after-rc-form140).
|
If you want to get `ref` after `Form.create`, you can use `wrappedComponentRef` provided by `rc-form`, [details can be viewed here](https://github.com/react-component/form#note-use-wrappedcomponentref-instead-of-withref-after-rc-form140).
|
||||||
|
|
||||||
@ -80,21 +80,21 @@ If the form has been decorated by `Form.create` then it has `this.props.form` pr
|
|||||||
|
|
||||||
> Note: Before using `getFieldsValue` `getFieldValue` `setFieldsValue` and so on, please make sure that corresponding field had been registered with `getFieldDecorator`.
|
> Note: Before using `getFieldsValue` `getFieldValue` `setFieldsValue` and so on, please make sure that corresponding field had been registered with `getFieldDecorator`.
|
||||||
|
|
||||||
| Method | Description | Type |
|
| Method | Description | Type | Version |
|
||||||
| --- | --- | --- |
|
| --- | --- | --- | --- |
|
||||||
| getFieldDecorator | Two-way binding for form, please read below for details. | |
|
| getFieldDecorator | Two-way binding for form, please read below for details. | |
|
||||||
| getFieldError | Get the error of a field. | Function(name) |
|
| getFieldError | Get the error of a field. | Function(name) | |
|
||||||
| getFieldsError | Get the specified fields' error. If you don't specify a parameter, you will get all fields' error. | Function(\[names: string\[]]) |
|
| getFieldsError | Get the specified fields' error. If you don't specify a parameter, you will get all fields' error. | Function(\[names: string\[]]) | |
|
||||||
| getFieldsValue | Get the specified fields' values. If you don't specify a parameter, you will get all fields' values. | Function(\[fieldNames: string\[]]) |
|
| getFieldsValue | Get the specified fields' values. If you don't specify a parameter, you will get all fields' values. | Function(\[fieldNames: string\[]]) | |
|
||||||
| getFieldValue | Get the value of a field. | Function(fieldName: string) |
|
| getFieldValue | Get the value of a field. | Function(fieldName: string) | |
|
||||||
| isFieldsTouched | Check whether any of fields is touched by `getFieldDecorator`'s `options.trigger` event | (names?: string\[]) => boolean |
|
| isFieldsTouched | Check whether any of fields is touched by `getFieldDecorator`'s `options.trigger` event | (names?: string\[]) => boolean | |
|
||||||
| isFieldTouched | Check whether a field is touched by `getFieldDecorator`'s `options.trigger` event | (name: string) => boolean |
|
| isFieldTouched | Check whether a field is touched by `getFieldDecorator`'s `options.trigger` event | (name: string) => boolean | |
|
||||||
| isFieldValidating | Check if the specified field is being validated. | Function(name) |
|
| isFieldValidating | Check if the specified field is being validated. | Function(name) | |
|
||||||
| resetFields | Reset the specified fields' value(to `initialValue`) and status. If you don't specify a parameter, all the fields will be reset. | Function(\[names: string\[]]) |
|
| resetFields | Reset the specified fields' value(to `initialValue`) and status. If you don't specify a parameter, all the fields will be reset. | Function(\[names: string\[]]) | |
|
||||||
| setFields | Set value and error state of fields. [Code Sample](https://github.com/react-component/form/blob/3b9959b57ab30b41d8890ff30c79a7e7c383cad3/examples/server-validate.js#L74-L79) | ({<br /> \[fieldName\]: {value: any, errors: \[Error\] }<br />}) => void |
|
| setFields | Set value and error state of fields. [Code Sample](https://github.com/react-component/form/blob/3b9959b57ab30b41d8890ff30c79a7e7c383cad3/examples/server-validate.js#L74-L79) | ({<br /> \[fieldName\]: {value: any, errors: \[Error\] }<br />}) => void | |
|
||||||
| setFieldsValue | Set the value of a field. (Note: please don't use it in `componentWillReceiveProps`, otherwise, it will cause an endless loop, [reason](https://github.com/ant-design/ant-design/issues/2985)) | ({ \[fieldName\]: value }) => void |
|
| setFieldsValue | Set the value of a field. (Note: please don't use it in `componentWillReceiveProps`, otherwise, it will cause an endless loop, [reason](https://github.com/ant-design/ant-design/issues/2985)) | ({ \[fieldName\]: value }) => void | |
|
||||||
| validateFields | Validate the specified fields and get theirs values and errors. If you don't specify the parameter of fieldNames, you will validate all fields. | (<br /> \[fieldNames: string\[]],<br /> \[options: object\],<br /> callback(errors, values)<br />) => void |
|
| validateFields | Validate the specified fields and get theirs values and errors. If you don't specify the parameter of fieldNames, you will validate all fields. | (<br /> \[fieldNames: string\[]],<br /> \[options: object\],<br /> callback(errors, values)<br />) => void | |
|
||||||
| validateFieldsAndScroll | This function is similar to `validateFields`, but after validation, if the target field is not in visible area of form, form will be automatically scrolled to the target field area. | same as `validateFields` |
|
| validateFieldsAndScroll | This function is similar to `validateFields`, but after validation, if the target field is not in visible area of form, form will be automatically scrolled to the target field area. | same as `validateFields` | |
|
||||||
|
|
||||||
### validateFields/validateFieldsAndScroll
|
### validateFields/validateFieldsAndScroll
|
||||||
|
|
||||||
@ -113,12 +113,12 @@ validateFields(['field1', 'field2'], options, (errors, values) => {
|
|||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
| Method | Description | Type | Default |
|
| Method | Description | Type | Default | Version |
|
||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- | --- |
|
||||||
| options.first | If `true`, every field will stop validation at first failed rule | boolean | false |
|
| options.first | If `true`, every field will stop validation at first failed rule | boolean | false | 3.9.3 |
|
||||||
| options.firstFields | Those fields will stop validation at first failed rule | String\[] | \[] |
|
| options.firstFields | Those fields will stop validation at first failed rule | String\[] | \[] | 3.9.3 |
|
||||||
| options.force | Should validate validated field again when `validateTrigger` is been triggered again | boolean | false |
|
| options.force | Should validate validated field again when `validateTrigger` is been triggered again | boolean | false | 3.9.3 |
|
||||||
| options.scroll | Config scroll behavior of `validateFieldsAndScroll`, more: [dom-scroll-into-view's config](https://github.com/yiminghe/dom-scroll-into-view#function-parameter) | Object | {} |
|
| options.scroll | Config scroll behavior of `validateFieldsAndScroll`, more: [dom-scroll-into-view's config](https://github.com/yiminghe/dom-scroll-into-view#function-parameter) | Object | {} | 3.9.3 |
|
||||||
|
|
||||||
#### Callback arguments example of validateFields
|
#### Callback arguments example of validateFields
|
||||||
|
|
||||||
@ -172,19 +172,19 @@ If you use `react@<15.3.0`, then, you can't use `getFieldDecorator` in stateless
|
|||||||
|
|
||||||
#### getFieldDecorator(id, options) parameters
|
#### getFieldDecorator(id, options) parameters
|
||||||
|
|
||||||
| Property | Description | Type | Default Value |
|
| Property | Description | Type | Default Value | Version |
|
||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- | --- |
|
||||||
| id | The unique identifier is required. support [nested fields format](https://github.com/react-component/form/pull/48). | string | |
|
| id | The unique identifier is required. support [nested fields format](https://github.com/react-component/form/pull/48). | string | | |
|
||||||
| options.getValueFromEvent | Specify how to get value from event or other onChange arguments | function(..args) | [reference](https://github.com/react-component/form#option-object) |
|
| options.getValueFromEvent | Specify how to get value from event or other onChange arguments | function(..args) | [reference](https://github.com/react-component/form#option-object) | |
|
||||||
| options.getValueProps | Get the component props according to field value. | function(value): any | [reference](https://github.com/react-component/form#option-object) |
|
| options.getValueProps | Get the component props according to field value. | function(value): any | [reference](https://github.com/react-component/form#option-object) | 3.9.0 |
|
||||||
| options.initialValue | You can specify initial value, type, optional value of children node. (Note: Because `Form` will test equality with `===` internally, we recommend to use variable as `initialValue`, instead of literal) | | n/a |
|
| options.initialValue | You can specify initial value, type, optional value of children node. (Note: Because `Form` will test equality with `===` internally, we recommend to use variable as `initialValue`, instead of literal) | | n/a | |
|
||||||
| options.normalize | Normalize value to form component, [a select-all example](https://codepen.io/afc163/pen/JJVXzG?editors=001) | function(value, prevValue, allValues): any | - |
|
| options.normalize | Normalize value to form component, [a select-all example](https://codepen.io/afc163/pen/JJVXzG?editors=001) | function(value, prevValue, allValues): any | - | |
|
||||||
| options.preserve | Keep the field even if field removed | boolean | - |
|
| options.preserve | Keep the field even if field removed | boolean | - | 3.12.0 |
|
||||||
| options.rules | Includes validation rules. Please refer to "Validation Rules" part for details. | object\[] | n/a |
|
| options.rules | Includes validation rules. Please refer to "Validation Rules" part for details. | object\[] | n/a | |
|
||||||
| options.trigger | When to collect the value of children node | string | 'onChange' |
|
| options.trigger | When to collect the value of children node | string | 'onChange' | |
|
||||||
| options.validateFirst | Whether stop validate on first rule of error for this field. | boolean | false |
|
| options.validateFirst | Whether stop validate on first rule of error for this field. | boolean | false | |
|
||||||
| options.validateTrigger | When to validate the value of children node. | string\|string\[] | 'onChange' |
|
| options.validateTrigger | When to validate the value of children node. | string\|string\[] | 'onChange' | |
|
||||||
| options.valuePropName | Props of children node, for example, the prop of Switch is 'checked'. | string | 'value' |
|
| options.valuePropName | Props of children node, for example, the prop of Switch is 'checked'. | string | 'value' | |
|
||||||
|
|
||||||
More option at [rc-form option](https://github.com/react-component/form#option-object)。
|
More option at [rc-form option](https://github.com/react-component/form#option-object)。
|
||||||
|
|
||||||
@ -207,19 +207,19 @@ Note: if Form.Item has multiple children that had been decorated by `getFieldDec
|
|||||||
|
|
||||||
### Validation Rules
|
### Validation Rules
|
||||||
|
|
||||||
| Property | Description | Type | Default Value |
|
| Property | Description | Type | Default Value | Version |
|
||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- | --- |
|
||||||
| enum | validate a value from a list of possible values | string | - |
|
| enum | validate a value from a list of possible values | string | - | |
|
||||||
| len | validate an exact length of a field | number | - |
|
| len | validate an exact length of a field | number | - | |
|
||||||
| max | validate a max length of a field | number | - |
|
| max | validate a max length of a field | number | - | |
|
||||||
| message | validation error message | string\|ReactNode | - |
|
| message | validation error message | string\|ReactNode | - | |
|
||||||
| min | validate a min length of a field | number | - |
|
| min | validate a min length of a field | number | - | |
|
||||||
| pattern | validate from a regular expression | RegExp | - |
|
| pattern | validate from a regular expression | RegExp | - | |
|
||||||
| required | indicates whether field is required | boolean | `false` |
|
| required | indicates whether field is required | boolean | `false` | |
|
||||||
| transform | transform a value before validation | function(value) => transformedValue:any | - |
|
| transform | transform a value before validation | function(value) => transformedValue:any | - | |
|
||||||
| type | built-in validation type, [available options](https://github.com/yiminghe/async-validator#type) | string | 'string' |
|
| type | built-in validation type, [available options](https://github.com/yiminghe/async-validator#type) | string | 'string' | |
|
||||||
| validator | custom validate function (Note: [callback must be called](https://github.com/ant-design/ant-design/issues/5155)) | function(rule, value, callback) | - |
|
| validator | custom validate function (Note: [callback must be called](https://github.com/ant-design/ant-design/issues/5155)) | function(rule, value, callback) | - | |
|
||||||
| whitespace | treat required fields that only contain whitespace as errors | boolean | `false` |
|
| whitespace | treat required fields that only contain whitespace as errors | boolean | `false` | |
|
||||||
|
|
||||||
See more advanced usage at [async-validator](https://github.com/yiminghe/async-validator).
|
See more advanced usage at [async-validator](https://github.com/yiminghe/async-validator).
|
||||||
|
|
||||||
|
@ -37,16 +37,16 @@ title: Form
|
|||||||
|
|
||||||
**更多示例参考 [rc-form](http://react-component.github.io/form/)**。
|
**更多示例参考 [rc-form](http://react-component.github.io/form/)**。
|
||||||
|
|
||||||
| 参数 | 说明 | 类型 | 默认值 |
|
| 参数 | 说明 | 类型 | 默认值 | 版本 |
|
||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- | --- |
|
||||||
| form | 经 `Form.create()` 包装过的组件会自带 `this.props.form` 属性 | object | - |
|
| form | 经 `Form.create()` 包装过的组件会自带 `this.props.form` 属性 | object | - | |
|
||||||
| hideRequiredMark | 隐藏所有表单项的必选标记 | Boolean | false |
|
| hideRequiredMark | 隐藏所有表单项的必选标记 | Boolean | false | |
|
||||||
| labelAlign | label 标签的文本对齐方式 | 'left' \| 'right' | 'right' |
|
| labelAlign | label 标签的文本对齐方式 | 'left' \| 'right' | 'right' | 3.15.0 |
|
||||||
| labelCol | (3.14.0 新增,之前的版本只能设置到 FormItem 上。)label 标签布局,同 `<Col>` 组件,设置 `span` `offset` 值,如 `{span: 3, offset: 12}` 或 `sm: {span: 3, offset: 12}` | [object](https://ant.design/components/grid/#Col) | |
|
| labelCol | (3.14.0 新增,之前的版本只能设置到 FormItem 上。)label 标签布局,同 `<Col>` 组件,设置 `span` `offset` 值,如 `{span: 3, offset: 12}` 或 `sm: {span: 3, offset: 12}` | [object](https://ant.design/components/grid/#Col) | | 3.14.0 |
|
||||||
| layout | 表单布局 | 'horizontal'\|'vertical'\|'inline' | 'horizontal' |
|
| layout | 表单布局 | 'horizontal'\|'vertical'\|'inline' | 'horizontal' | |
|
||||||
| onSubmit | 数据验证成功后回调事件 | Function(e:Event) | |
|
| onSubmit | 数据验证成功后回调事件 | Function(e:Event) | | |
|
||||||
| wrapperCol | (3.14.0 新增,之前的版本只能设置到 FormItem 上。)需要为输入控件设置布局样式时,使用该属性,用法同 labelCol | [object](https://ant.design/components/grid/#Col) | |
|
| wrapperCol | (3.14.0 新增,之前的版本只能设置到 FormItem 上。)需要为输入控件设置布局样式时,使用该属性,用法同 labelCol | [object](https://ant.design/components/grid/#Col) | | 3.14.0 |
|
||||||
| colon | 配置 Form.Item 的 colon 的默认值 | boolean | true |
|
| colon | 配置 Form.Item 的 colon 的默认值 | boolean | true | 3.15.0 |
|
||||||
|
|
||||||
### Form.create(options)
|
### Form.create(options)
|
||||||
|
|
||||||
@ -60,13 +60,13 @@ CustomizedForm = Form.create({})(CustomizedForm);
|
|||||||
|
|
||||||
`options` 的配置项如下。
|
`options` 的配置项如下。
|
||||||
|
|
||||||
| 参数 | 说明 | 类型 |
|
| 参数 | 说明 | 类型 | 版本 |
|
||||||
| --- | --- | --- |
|
| --- | --- | --- | --- |
|
||||||
| mapPropsToFields | 把父组件的属性映射到表单项上(如:把 Redux store 中的值读出),需要对返回值中的表单域数据用 [`Form.createFormField`](#Form.createFormField) 标记,注意表单项将变成受控组件, error 等也需要一并手动传入 | (props) => ({ \[fieldName\]: FormField { value } }) |
|
| mapPropsToFields | 把父组件的属性映射到表单项上(如:把 Redux store 中的值读出),需要对返回值中的表单域数据用 [`Form.createFormField`](#Form.createFormField) 标记,注意表单项将变成受控组件, error 等也需要一并手动传入 | (props) => ({ \[fieldName\]: FormField { value } }) | |
|
||||||
| name | 设置表单域内字段 id 的前缀 | - |
|
| name | 设置表单域内字段 id 的前缀 | - | 3.12.0 |
|
||||||
| validateMessages | 默认校验信息,可用于把默认错误信息改为中文等,格式与 [newMessages](https://github.com/yiminghe/async-validator/blob/master/src/messages.js) 返回值一致 | Object { \[nested.path]: String } |
|
| validateMessages | 默认校验信息,可用于把默认错误信息改为中文等,格式与 [newMessages](https://github.com/yiminghe/async-validator/blob/master/src/messages.js) 返回值一致 | Object { \[nested.path]: String } | |
|
||||||
| onFieldsChange | 当 `Form.Item` 子节点的值(包括 error)发生改变时触发,可以把对应的值转存到 Redux store | Function(props, changedFields, allFields) |
|
| onFieldsChange | 当 `Form.Item` 子节点的值(包括 error)发生改变时触发,可以把对应的值转存到 Redux store | Function(props, changedFields, allFields) | |
|
||||||
| onValuesChange | 任一表单域的值发生改变时的回调 | (props, changedValues, allValues) => void |
|
| onValuesChange | 任一表单域的值发生改变时的回调 | (props, changedValues, allValues) => void | |
|
||||||
|
|
||||||
经过 `Form.create` 之后如果要拿到 `ref`,可以使用 `rc-form` 提供的 `wrappedComponentRef`,[详细内容可以查看这里](https://github.com/react-component/form#note-use-wrappedcomponentref-instead-of-withref-after-rc-form140)。
|
经过 `Form.create` 之后如果要拿到 `ref`,可以使用 `rc-form` 提供的 `wrappedComponentRef`,[详细内容可以查看这里](https://github.com/react-component/form#note-use-wrappedcomponentref-instead-of-withref-after-rc-form140)。
|
||||||
|
|
||||||
@ -83,21 +83,21 @@ this.form // => The instance of CustomizedForm
|
|||||||
|
|
||||||
> 注意:使用 `getFieldsValue` `getFieldValue` `setFieldsValue` 等时,应确保对应的 field 已经用 `getFieldDecorator` 注册过了。
|
> 注意:使用 `getFieldsValue` `getFieldValue` `setFieldsValue` 等时,应确保对应的 field 已经用 `getFieldDecorator` 注册过了。
|
||||||
|
|
||||||
| 方法 | 说明 | 类型 |
|
| 方法 | 说明 | 类型 | 版本 |
|
||||||
| --- | --- | --- |
|
| --- | --- | --- | --- |
|
||||||
| getFieldDecorator | 用于和表单进行双向绑定,详见下方描述 | |
|
| getFieldDecorator | 用于和表单进行双向绑定,详见下方描述 | |
|
||||||
| getFieldError | 获取某个输入控件的 Error | Function(name) |
|
| getFieldError | 获取某个输入控件的 Error | Function(name) | |
|
||||||
| getFieldsError | 获取一组输入控件的 Error ,如不传入参数,则获取全部组件的 Error | Function(\[names: string\[]]) |
|
| getFieldsError | 获取一组输入控件的 Error ,如不传入参数,则获取全部组件的 Error | Function(\[names: string\[]]) | |
|
||||||
| getFieldsValue | 获取一组输入控件的值,如不传入参数,则获取全部组件的值 | Function(\[fieldNames: string\[]]) |
|
| getFieldsValue | 获取一组输入控件的值,如不传入参数,则获取全部组件的值 | Function(\[fieldNames: string\[]]) | |
|
||||||
| getFieldValue | 获取一个输入控件的值 | Function(fieldName: string) |
|
| getFieldValue | 获取一个输入控件的值 | Function(fieldName: string) | |
|
||||||
| isFieldsTouched | 判断是否任一输入控件经历过 `getFieldDecorator` 的值收集时机 `options.trigger` | (names?: string\[]) => boolean |
|
| isFieldsTouched | 判断是否任一输入控件经历过 `getFieldDecorator` 的值收集时机 `options.trigger` | (names?: string\[]) => boolean | |
|
||||||
| isFieldTouched | 判断一个输入控件是否经历过 `getFieldDecorator` 的值收集时机 `options.trigger` | (name: string) => boolean |
|
| isFieldTouched | 判断一个输入控件是否经历过 `getFieldDecorator` 的值收集时机 `options.trigger` | (name: string) => boolean | |
|
||||||
| isFieldValidating | 判断一个输入控件是否在校验状态 | Function(name) |
|
| isFieldValidating | 判断一个输入控件是否在校验状态 | Function(name) | |
|
||||||
| resetFields | 重置一组输入控件的值(为 `initialValue`)与状态,如不传入参数,则重置所有组件 | Function(\[names: string\[]]) |
|
| resetFields | 重置一组输入控件的值(为 `initialValue`)与状态,如不传入参数,则重置所有组件 | Function(\[names: string\[]]) | |
|
||||||
| setFields | 设置一组输入控件的值与错误状态:[代码](https://github.com/react-component/form/blob/3b9959b57ab30b41d8890ff30c79a7e7c383cad3/examples/server-validate.js#L74-L79) | ({<br /> \[fieldName\]: {value: any, errors: \[Error\] }<br />}) => void |
|
| setFields | 设置一组输入控件的值与错误状态:[代码](https://github.com/react-component/form/blob/3b9959b57ab30b41d8890ff30c79a7e7c383cad3/examples/server-validate.js#L74-L79) | ({<br /> \[fieldName\]: {value: any, errors: \[Error\] }<br />}) => void | |
|
||||||
| setFieldsValue | 设置一组输入控件的值(注意:不要在 `componentWillReceiveProps` 内使用,否则会导致死循环,[原因](https://github.com/ant-design/ant-design/issues/2985)) | ({ \[fieldName\]: value }) => void |
|
| setFieldsValue | 设置一组输入控件的值(注意:不要在 `componentWillReceiveProps` 内使用,否则会导致死循环,[原因](https://github.com/ant-design/ant-design/issues/2985)) | ({ \[fieldName\]: value }) => void | |
|
||||||
| validateFields | 校验并获取一组输入域的值与 Error,若 fieldNames 参数为空,则校验全部组件 | (<br /> \[fieldNames: string\[]],<br /> \[options: object\],<br /> callback(errors, values)<br />) => void |
|
| validateFields | 校验并获取一组输入域的值与 Error,若 fieldNames 参数为空,则校验全部组件 | (<br /> \[fieldNames: string\[]],<br /> \[options: object\],<br /> callback(errors, values)<br />) => void | |
|
||||||
| validateFieldsAndScroll | 与 `validateFields` 相似,但校验完后,如果校验不通过的菜单域不在可见范围内,则自动滚动进可见范围 | 参考 `validateFields` |
|
| validateFieldsAndScroll | 与 `validateFields` 相似,但校验完后,如果校验不通过的菜单域不在可见范围内,则自动滚动进可见范围 | 参考 `validateFields` | |
|
||||||
|
|
||||||
### validateFields/validateFieldsAndScroll
|
### validateFields/validateFieldsAndScroll
|
||||||
|
|
||||||
@ -116,12 +116,12 @@ validateFields(['field1', 'field2'], options, (errors, values) => {
|
|||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
| 参数 | 说明 | 类型 | 默认值 |
|
| 参数 | 说明 | 类型 | 默认值 | 版本 |
|
||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- | --- |
|
||||||
| options.first | 若为 true,则每一表单域的都会在碰到第一个失败了的校验规则后停止校验 | boolean | false |
|
| options.first | 若为 true,则每一表单域的都会在碰到第一个失败了的校验规则后停止校验 | boolean | false | 3.9.3 |
|
||||||
| options.firstFields | 指定表单域会在碰到第一个失败了的校验规则后停止校验 | String\[] | \[] |
|
| options.firstFields | 指定表单域会在碰到第一个失败了的校验规则后停止校验 | String\[] | \[] | 3.9.3 |
|
||||||
| options.force | 对已经校验过的表单域,在 validateTrigger 再次被触发时是否再次校验 | boolean | false |
|
| options.force | 对已经校验过的表单域,在 validateTrigger 再次被触发时是否再次校验 | boolean | false | 3.9.3 |
|
||||||
| options.scroll | 定义 validateFieldsAndScroll 的滚动行为,详细配置见 [dom-scroll-into-view config](https://github.com/yiminghe/dom-scroll-into-view#function-parameter) | Object | {} |
|
| options.scroll | 定义 validateFieldsAndScroll 的滚动行为,详细配置见 [dom-scroll-into-view config](https://github.com/yiminghe/dom-scroll-into-view#function-parameter) | Object | {} | 3.9.3 |
|
||||||
|
|
||||||
#### validateFields 的 callback 参数示例
|
#### validateFields 的 callback 参数示例
|
||||||
|
|
||||||
@ -175,18 +175,18 @@ validateFields(['field1', 'field2'], options, (errors, values) => {
|
|||||||
|
|
||||||
#### getFieldDecorator(id, options) 参数
|
#### getFieldDecorator(id, options) 参数
|
||||||
|
|
||||||
| 参数 | 说明 | 类型 | 默认值 |
|
| 参数 | 说明 | 类型 | 默认值 | 版本 |
|
||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- | --- |
|
||||||
| id | 必填输入控件唯一标志。支持嵌套式的[写法](https://github.com/react-component/form/pull/48)。 | string | |
|
| id | 必填输入控件唯一标志。支持嵌套式的[写法](https://github.com/react-component/form/pull/48)。 | string | | |
|
||||||
| options.getValueFromEvent | 可以把 onChange 的参数(如 event)转化为控件的值 | function(..args) | [reference](https://github.com/react-component/form#option-object) |
|
| options.getValueFromEvent | 可以把 onChange 的参数(如 event)转化为控件的值 | function(..args) | [reference](https://github.com/react-component/form#option-object) | |
|
||||||
| options.initialValue | 子节点的初始值,类型、可选值均由子节点决定(注意:由于内部校验时使用 `===` 判断是否变化,建议使用变量缓存所需设置的值而非直接使用字面量)) | | |
|
| options.initialValue | 子节点的初始值,类型、可选值均由子节点决定(注意:由于内部校验时使用 `===` 判断是否变化,建议使用变量缓存所需设置的值而非直接使用字面量)) | | | |
|
||||||
| options.normalize | 转换默认的 value 给控件,[一个选择全部的例子](https://codepen.io/afc163/pen/JJVXzG?editors=001) | function(value, prevValue, allValues): any | - |
|
| options.normalize | 转换默认的 value 给控件,[一个选择全部的例子](https://codepen.io/afc163/pen/JJVXzG?editors=001) | function(value, prevValue, allValues): any | - | |
|
||||||
| options.preserve | 即便字段不再使用,也保留该字段的值 | boolean | - |
|
| options.preserve | 即便字段不再使用,也保留该字段的值 | boolean | - | 3.12.0 |
|
||||||
| options.rules | 校验规则,参考下方文档 | object\[] | |
|
| options.rules | 校验规则,参考下方文档 | object\[] | | |
|
||||||
| options.trigger | 收集子节点的值的时机 | string | 'onChange' |
|
| options.trigger | 收集子节点的值的时机 | string | 'onChange' | |
|
||||||
| options.validateFirst | 当某一规则校验不通过时,是否停止剩下的规则的校验 | boolean | false |
|
| options.validateFirst | 当某一规则校验不通过时,是否停止剩下的规则的校验 | boolean | false | |
|
||||||
| options.validateTrigger | 校验子节点值的时机 | string\|string\[] | 'onChange' |
|
| options.validateTrigger | 校验子节点值的时机 | string\|string\[] | 'onChange' | |
|
||||||
| options.valuePropName | 子节点的值的属性,如 Switch 的是 'checked' | string | 'value' |
|
| options.valuePropName | 子节点的值的属性,如 Switch 的是 'checked' | string | 'value' | |
|
||||||
|
|
||||||
更多参数请查看 [rc-form option](https://github.com/react-component/form#option-object)。
|
更多参数请查看 [rc-form option](https://github.com/react-component/form#option-object)。
|
||||||
|
|
||||||
@ -209,19 +209,19 @@ validateFields(['field1', 'field2'], options, (errors, values) => {
|
|||||||
|
|
||||||
### 校验规则
|
### 校验规则
|
||||||
|
|
||||||
| 参数 | 说明 | 类型 | 默认值 |
|
| 参数 | 说明 | 类型 | 默认值 | 版本 |
|
||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- | --- |
|
||||||
| enum | 枚举类型 | string | - |
|
| enum | 枚举类型 | string | - | |
|
||||||
| len | 字段长度 | number | - |
|
| len | 字段长度 | number | - | |
|
||||||
| max | 最大长度 | number | - |
|
| max | 最大长度 | number | - | |
|
||||||
| message | 校验文案 | string\|ReactNode | - |
|
| message | 校验文案 | string\|ReactNode | - | |
|
||||||
| min | 最小长度 | number | - |
|
| min | 最小长度 | number | - | |
|
||||||
| pattern | 正则表达式校验 | RegExp | - |
|
| pattern | 正则表达式校验 | RegExp | - | |
|
||||||
| required | 是否必选 | boolean | `false` |
|
| required | 是否必选 | boolean | `false` | |
|
||||||
| transform | 校验前转换字段值 | function(value) => transformedValue:any | - |
|
| transform | 校验前转换字段值 | function(value) => transformedValue:any | - | |
|
||||||
| type | 内建校验类型,[可选项](https://github.com/yiminghe/async-validator#type) | string | 'string' |
|
| type | 内建校验类型,[可选项](https://github.com/yiminghe/async-validator#type) | string | 'string' | |
|
||||||
| validator | 自定义校验(注意,[callback 必须被调用](https://github.com/ant-design/ant-design/issues/5155)) | function(rule, value, callback) | - |
|
| validator | 自定义校验(注意,[callback 必须被调用](https://github.com/ant-design/ant-design/issues/5155)) | function(rule, value, callback) | - | |
|
||||||
| whitespace | 必选时,空格是否会被视为错误 | boolean | `false` |
|
| whitespace | 必选时,空格是否会被视为错误 | boolean | `false` | |
|
||||||
|
|
||||||
更多高级用法可研究 [async-validator](https://github.com/yiminghe/async-validator)。
|
更多高级用法可研究 [async-validator](https://github.com/yiminghe/async-validator)。
|
||||||
|
|
||||||
|
@ -88,28 +88,28 @@ If the Ant Design grid layout component does not meet your needs, you can use th
|
|||||||
|
|
||||||
### Row
|
### Row
|
||||||
|
|
||||||
| Property | Description | Type | Default |
|
| Property | Description | Type | Default | Version |
|
||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- | --- |
|
||||||
| align | the vertical alignment of the flex layout: `top` `middle` `bottom` | string | `top` |
|
| align | the vertical alignment of the flex layout: `top` `middle` `bottom` | string | `top` | |
|
||||||
| gutter | spacing between grids, could be a number or a object like `{ xs: 8, sm: 16, md: 24}` | number/object | 0 |
|
| gutter | spacing between grids, could be a number or a object like `{ xs: 8, sm: 16, md: 24}` | number/object | 0 | |
|
||||||
| justify | horizontal arrangement of the flex layout: `start` `end` `center` `space-around` `space-between` | string | `start` |
|
| justify | horizontal arrangement of the flex layout: `start` `end` `center` `space-around` `space-between` | string | `start` | |
|
||||||
| type | layout mode, optional `flex`, [browser support](http://caniuse.com/#search=flex) | string | |
|
| type | layout mode, optional `flex`, [browser support](http://caniuse.com/#search=flex) | string | | |
|
||||||
|
|
||||||
### Col
|
### Col
|
||||||
|
|
||||||
| Property | Description | Type | Default |
|
| Property | Description | Type | Default | Version |
|
||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- | --- |
|
||||||
| offset | the number of cells to offset Col from the left | number | 0 |
|
| offset | the number of cells to offset Col from the left | number | 0 | |
|
||||||
| order | raster order, used in `flex` layout mode | number | 0 |
|
| order | raster order, used in `flex` layout mode | number | 0 | |
|
||||||
| pull | the number of cells that raster is moved to the left | number | 0 |
|
| pull | the number of cells that raster is moved to the left | number | 0 | |
|
||||||
| push | the number of cells that raster is moved to the right | number | 0 |
|
| push | the number of cells that raster is moved to the right | number | 0 | |
|
||||||
| span | raster number of cells to occupy, 0 corresponds to `display: none` | number | none |
|
| span | raster number of cells to occupy, 0 corresponds to `display: none` | number | none | |
|
||||||
| xs | `<576px` and also default setting, could be a `span` value or an object containing above props | number\|object | - |
|
| xs | `<576px` and also default setting, could be a `span` value or an object containing above props | number\|object | - | |
|
||||||
| sm | `≥576px`, could be a `span` value or an object containing above props | number\|object | - |
|
| sm | `≥576px`, could be a `span` value or an object containing above props | number\|object | - | |
|
||||||
| md | `≥768px`, could be a `span` value or an object containing above props | number\|object | - |
|
| md | `≥768px`, could be a `span` value or an object containing above props | number\|object | - | |
|
||||||
| lg | `≥992px`, could be a `span` value or an object containing above props | number\|object | - |
|
| lg | `≥992px`, could be a `span` value or an object containing above props | number\|object | - | |
|
||||||
| xl | `≥1200px`, could be a `span` value or an object containing above props | number\|object | - |
|
| xl | `≥1200px`, could be a `span` value or an object containing above props | number\|object | - | |
|
||||||
| xxl | `≥1600px`, could be a `span` value or an object containing above props | number\|object | - |
|
| xxl | `≥1600px`, could be a `span` value or an object containing above props | number\|object | - | |
|
||||||
|
|
||||||
The breakpoints of responsive grid follow [BootStrap 4 media queries rules](https://getbootstrap.com/docs/4.0/layout/overview/#responsive-breakpoints)(not including `occasionally part`).
|
The breakpoints of responsive grid follow [BootStrap 4 media queries rules](https://getbootstrap.com/docs/4.0/layout/overview/#responsive-breakpoints)(not including `occasionally part`).
|
||||||
|
|
||||||
|
@ -87,28 +87,28 @@ Ant Design 的布局组件若不能满足你的需求,你也可以直接使用
|
|||||||
|
|
||||||
### Row
|
### Row
|
||||||
|
|
||||||
| 成员 | 说明 | 类型 | 默认值 |
|
| 成员 | 说明 | 类型 | 默认值 | 版本 |
|
||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- | --- |
|
||||||
| align | flex 布局下的垂直对齐方式:`top` `middle` `bottom` | string | `top` |
|
| align | flex 布局下的垂直对齐方式:`top` `middle` `bottom` | string | `top` | |
|
||||||
| gutter | 栅格间隔,可以写成像素值或支持响应式的对象写法 `{ xs: 8, sm: 16, md: 24}` | number/object | 0 |
|
| gutter | 栅格间隔,可以写成像素值或支持响应式的对象写法 `{ xs: 8, sm: 16, md: 24}` | number/object | 0 | |
|
||||||
| justify | flex 布局下的水平排列方式:`start` `end` `center` `space-around` `space-between` | string | `start` |
|
| justify | flex 布局下的水平排列方式:`start` `end` `center` `space-around` `space-between` | string | `start` | |
|
||||||
| type | 布局模式,可选 `flex`,[现代浏览器](http://caniuse.com/#search=flex) 下有效 | string | |
|
| type | 布局模式,可选 `flex`,[现代浏览器](http://caniuse.com/#search=flex) 下有效 | string | | |
|
||||||
|
|
||||||
### Col
|
### Col
|
||||||
|
|
||||||
| 成员 | 说明 | 类型 | 默认值 |
|
| 成员 | 说明 | 类型 | 默认值 | 版本 |
|
||||||
| ------ | -------------------------------------------------------- | -------------- | ------ |
|
| --- | --- | --- | --- | --- |
|
||||||
| offset | 栅格左侧的间隔格数,间隔内不可以有栅格 | number | 0 |
|
| offset | 栅格左侧的间隔格数,间隔内不可以有栅格 | number | 0 | |
|
||||||
| order | 栅格顺序,`flex` 布局模式下有效 | number | 0 |
|
| order | 栅格顺序,`flex` 布局模式下有效 | number | 0 | |
|
||||||
| pull | 栅格向左移动格数 | number | 0 |
|
| pull | 栅格向左移动格数 | number | 0 | |
|
||||||
| push | 栅格向右移动格数 | number | 0 |
|
| push | 栅格向右移动格数 | number | 0 | |
|
||||||
| span | 栅格占位格数,为 0 时相当于 `display: none` | number | - |
|
| span | 栅格占位格数,为 0 时相当于 `display: none` | number | - | |
|
||||||
| xs | `<576px` 响应式栅格,可为栅格数或一个包含其他属性的对象 | number\|object | - |
|
| xs | `<576px` 响应式栅格,可为栅格数或一个包含其他属性的对象 | number\|object | - | |
|
||||||
| sm | `≥576px` 响应式栅格,可为栅格数或一个包含其他属性的对象 | number\|object | - |
|
| sm | `≥576px` 响应式栅格,可为栅格数或一个包含其他属性的对象 | number\|object | - | |
|
||||||
| md | `≥768px` 响应式栅格,可为栅格数或一个包含其他属性的对象 | number\|object | - |
|
| md | `≥768px` 响应式栅格,可为栅格数或一个包含其他属性的对象 | number\|object | - | |
|
||||||
| lg | `≥992px` 响应式栅格,可为栅格数或一个包含其他属性的对象 | number\|object | - |
|
| lg | `≥992px` 响应式栅格,可为栅格数或一个包含其他属性的对象 | number\|object | - | |
|
||||||
| xl | `≥1200px` 响应式栅格,可为栅格数或一个包含其他属性的对象 | number\|object | - |
|
| xl | `≥1200px` 响应式栅格,可为栅格数或一个包含其他属性的对象 | number\|object | - | |
|
||||||
| xxl | `≥1600px` 响应式栅格,可为栅格数或一个包含其他属性的对象 | number\|object | - |
|
| xxl | `≥1600px` 响应式栅格,可为栅格数或一个包含其他属性的对象 | number\|object | - | |
|
||||||
|
|
||||||
响应式栅格的断点扩展自 [BootStrap 4 的规则](https://getbootstrap.com/docs/4.0/layout/overview/#responsive-breakpoints)(不包含链接里 `occasionally` 的部分)。
|
响应式栅格的断点扩展自 [BootStrap 4 的规则](https://getbootstrap.com/docs/4.0/layout/overview/#responsive-breakpoints)(不包含链接里 `occasionally` 的部分)。
|
||||||
|
|
||||||
|
@ -16,15 +16,15 @@ ReactDOM.render(<IconDisplay />, mountNode);
|
|||||||
|
|
||||||
## API
|
## API
|
||||||
|
|
||||||
| Property | Description | Type | Default |
|
| Property | Description | Type | Default | Version |
|
||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- | --- |
|
||||||
| type | Type of the ant design icon | string | - |
|
| type | Type of the ant design icon | string | - | |
|
||||||
| style | Style properties of icon, like `fontSize` and `color` | CSSProperties | - |
|
| style | Style properties of icon, like `fontSize` and `color` | CSSProperties | - | |
|
||||||
| theme | Theme of the ant design icon | 'filled' \| 'outlined' \| 'twoTone' | 'outlined' |
|
| theme | Theme of the ant design icon | 'filled' \| 'outlined' \| 'twoTone' | 'outlined' | 3.9.0 |
|
||||||
| spin | Rotate icon with animation | boolean | false |
|
| spin | Rotate icon with animation | boolean | false | |
|
||||||
| rotate | Rotate degrees (added in 3.13.0, not working in IE9) | number | - |
|
| rotate | Rotate degrees (added in 3.13.0, not working in IE9) | number | - | 3.13.0 |
|
||||||
| component | The component used for the root node. This will override the **`type`** property. | ComponentType<CustomIconComponentProps\> | - |
|
| component | The component used for the root node. This will override the **`type`** property. | ComponentType<CustomIconComponentProps\> | - | 3.9.0 |
|
||||||
| twoToneColor | Only support the two-tone icon. Specific the primary color. | string (hex color) | - |
|
| twoToneColor | Only support the two-tone icon. Specific the primary color. | string (hex color) | - | 3.9.0 |
|
||||||
|
|
||||||
### SVG icons
|
### SVG icons
|
||||||
|
|
||||||
@ -80,10 +80,10 @@ It create a component that uses SVG sprites in essence.
|
|||||||
|
|
||||||
The following options are available:
|
The following options are available:
|
||||||
|
|
||||||
| Property | Description | Type | Default |
|
| Property | Description | Type | Default | Version |
|
||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- | --- |
|
||||||
| scriptUrl | The URL generated by [iconfont.cn](http://iconfont.cn/) project. | string | - |
|
| scriptUrl | The URL generated by [iconfont.cn](http://iconfont.cn/) project. | string | - | 3.9.3 |
|
||||||
| extraCommonProps | Define extra properties to the component | `{ [key: string]: any }` | {} |
|
| extraCommonProps | Define extra properties to the component | `{ [key: string]: any }` | {} | 3.9.3 |
|
||||||
|
|
||||||
The property `scriptUrl` should be set to import the SVG sprite symbols.
|
The property `scriptUrl` should be set to import the SVG sprite symbols.
|
||||||
|
|
||||||
@ -121,10 +121,10 @@ ReactDOM.render(<Icon component={MessageSvg} />, mountNode);
|
|||||||
|
|
||||||
The following properties are available for the component:
|
The following properties are available for the component:
|
||||||
|
|
||||||
| Property | Description | Type | Default |
|
| Property | Description | Type | Default | Version |
|
||||||
| --------- | ------------------------------------------------ | ---------------- | -------------- |
|
| --- | --- | --- | --- | --- |
|
||||||
| width | The width of the `svg` element | string \| number | '1em' |
|
| width | The width of the `svg` element | string \| number | '1em' | 3.10.0 |
|
||||||
| height | The height of the `svg` element | string \| number | '1em' |
|
| height | The height of the `svg` element | string \| number | '1em' | 3.10.0 |
|
||||||
| fill | Define the color used to paint the `svg` element | string | 'currentColor' |
|
| fill | Define the color used to paint the `svg` element | string | 'currentColor' | 3.10.0 |
|
||||||
| className | The computed class name of the `svg` element | string | - |
|
| className | The computed class name of the `svg` element | string | - | 3.10.0 |
|
||||||
| style | The computed style of the `svg` element | CSSProperties | - |
|
| style | The computed style of the `svg` element | CSSProperties | - | 3.10.0 |
|
||||||
|
@ -21,15 +21,15 @@ ReactDOM.render(<IconDisplay />, mountNode);
|
|||||||
|
|
||||||
## API
|
## API
|
||||||
|
|
||||||
| 参数 | 说明 | 类型 | 默认值 |
|
| 参数 | 说明 | 类型 | 默认值 | 版本 |
|
||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- | --- |
|
||||||
| type | 图标类型。遵循图标的命名规范 | string | - |
|
| type | 图标类型。遵循图标的命名规范 | string | - | |
|
||||||
| style | 设置图标的样式,例如 `fontSize` 和 `color` | CSSProperties | - |
|
| style | 设置图标的样式,例如 `fontSize` 和 `color` | CSSProperties | - | |
|
||||||
| theme | 图标主题风格。可选实心、描线、双色等主题风格,适用于官方图标 | 'filled' \| 'outlined' \| 'twoTone' | 'outlined' |
|
| theme | 图标主题风格。可选实心、描线、双色等主题风格,适用于官方图标 | 'filled' \| 'outlined' \| 'twoTone' | 'outlined' | 3.9.0 |
|
||||||
| spin | 是否有旋转动画 | boolean | false |
|
| spin | 是否有旋转动画 | boolean | false | |
|
||||||
| rotate | 图标旋转角度(3.13.0 后新增,IE9 无效) | number | - |
|
| rotate | 图标旋转角度(3.13.0 后新增,IE9 无效) | number | - | 3.13.0 |
|
||||||
| component | 控制如何渲染图标,通常是一个渲染根标签为 `<svg>` 的 `React` 组件,**会使 `type` 属性失效** | ComponentType<CustomIconComponentProps\> | - |
|
| component | 控制如何渲染图标,通常是一个渲染根标签为 `<svg>` 的 `React` 组件,**会使 `type` 属性失效** | ComponentType<CustomIconComponentProps\> | - | 3.9.0 |
|
||||||
| twoToneColor | 仅适用双色图标。设置双色图标的主要颜色 | string (十六进制颜色) | - |
|
| twoToneColor | 仅适用双色图标。设置双色图标的主要颜色 | string (十六进制颜色) | - | 3.9.0 |
|
||||||
|
|
||||||
### SVG 图标
|
### SVG 图标
|
||||||
|
|
||||||
@ -83,10 +83,10 @@ ReactDOM.render(<MyIcon type="icon-example" />, mountedNode);
|
|||||||
|
|
||||||
`options` 的配置项如下:
|
`options` 的配置项如下:
|
||||||
|
|
||||||
| 参数 | 说明 | 类型 | 默认值 |
|
| 参数 | 说明 | 类型 | 默认值 | 版本 |
|
||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- | --- |
|
||||||
| scriptUrl | [iconfont.cn](http://iconfont.cn/) 项目在线生成的 `js` 地址 | string | - |
|
| scriptUrl | [iconfont.cn](http://iconfont.cn/) 项目在线生成的 `js` 地址 | string | - | 3.9.3 |
|
||||||
| extraCommonProps | 给所有的 `svg` 图标 `<Icon />` 组件设置额外的属性 | `{ [key: string]: any }` | {} |
|
| extraCommonProps | 给所有的 `svg` 图标 `<Icon />` 组件设置额外的属性 | `{ [key: string]: any }` | {} | 3.9.3 |
|
||||||
|
|
||||||
在 `scriptUrl` 都设置有效的情况下,组件在渲染前会自动引入 [iconfont.cn](http://iconfont.cn/) 项目中的图标符号集,无需手动引入。
|
在 `scriptUrl` 都设置有效的情况下,组件在渲染前会自动引入 [iconfont.cn](http://iconfont.cn/) 项目中的图标符号集,无需手动引入。
|
||||||
|
|
||||||
@ -124,10 +124,10 @@ ReactDOM.render(<Icon component={MessageSvg} />, mountNode);
|
|||||||
|
|
||||||
`Icon` 中的 `component` 组件的接受的属性如下:
|
`Icon` 中的 `component` 组件的接受的属性如下:
|
||||||
|
|
||||||
| 字段 | 说明 | 类型 | 只读值 |
|
| 字段 | 说明 | 类型 | 只读值 | 版本 |
|
||||||
| --------- | ----------------------- | ---------------- | -------------- |
|
| --------- | ----------------------- | ---------------- | -------------- | ------ |
|
||||||
| width | `svg` 元素宽度 | string \| number | '1em' |
|
| width | `svg` 元素宽度 | string \| number | '1em' | 3.10.0 |
|
||||||
| height | `svg` 元素高度 | string \| number | '1em' |
|
| height | `svg` 元素高度 | string \| number | '1em' | 3.10.0 |
|
||||||
| fill | `svg` 元素填充的颜色 | string | 'currentColor' |
|
| fill | `svg` 元素填充的颜色 | string | 'currentColor' | 3.10.0 |
|
||||||
| className | 计算后的 `svg` 类名 | string | - |
|
| className | 计算后的 `svg` 类名 | string | - | 3.10.0 |
|
||||||
| style | 计算后的 `svg` 元素样式 | CSSProperties | - |
|
| style | 计算后的 `svg` 元素样式 | CSSProperties | - | 3.10.0 |
|
||||||
|
@ -12,25 +12,25 @@ When a numeric value needs to be provided.
|
|||||||
|
|
||||||
## API
|
## API
|
||||||
|
|
||||||
| Property | Description | Type | Default |
|
| Property | Description | Type | Default | Version |
|
||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- | --- |
|
||||||
| autoFocus | get focus when component mounted | boolean | false |
|
| autoFocus | get focus when component mounted | boolean | false | |
|
||||||
| defaultValue | initial value | number | |
|
| defaultValue | initial value | number | | |
|
||||||
| disabled | disable the input | boolean | false |
|
| disabled | disable the input | boolean | false | |
|
||||||
| formatter | Specifies the format of the value presented | function(value: number \| string): string | - |
|
| formatter | Specifies the format of the value presented | function(value: number \| string): string | - | |
|
||||||
| max | max value | number | Infinity |
|
| max | max value | number | Infinity | |
|
||||||
| min | min value | number | -Infinity |
|
| min | min value | number | -Infinity | |
|
||||||
| parser | Specifies the value extracted from formatter | function( string): number | - |
|
| parser | Specifies the value extracted from formatter | function( string): number | - | |
|
||||||
| precision | precision of input value | number | - |
|
| precision | precision of input value | number | - | |
|
||||||
| decimalSeparator | decimal separator | string | - |
|
| decimalSeparator | decimal separator | string | - | 3.10.1 |
|
||||||
| size | height of input box | string | - |
|
| size | height of input box | string | - | |
|
||||||
| step | The number to which the current value is increased or decreased. It can be an integer or decimal. | number\|string | 1 |
|
| step | The number to which the current value is increased or decreased. It can be an integer or decimal. | number\|string | 1 | |
|
||||||
| value | current value | number | |
|
| value | current value | number | | |
|
||||||
| onChange | The callback triggered when the value is changed. | function(value: number \| string) | |
|
| onChange | The callback triggered when the value is changed. | function(value: number \| string) | | |
|
||||||
|
|
||||||
## Methods
|
## Methods
|
||||||
|
|
||||||
| Name | Description |
|
| Name | Description | Version |
|
||||||
| ------- | ------------ |
|
| ------- | ------------ | ------- |
|
||||||
| blur() | remove focus |
|
| blur() | remove focus | |
|
||||||
| focus() | get focus |
|
| focus() | get focus | |
|
||||||
|
@ -15,25 +15,25 @@ title: InputNumber
|
|||||||
|
|
||||||
属性如下
|
属性如下
|
||||||
|
|
||||||
| 成员 | 说明 | 类型 | 默认值 |
|
| 成员 | 说明 | 类型 | 默认值 | 版本 |
|
||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- | --- |
|
||||||
| autoFocus | 自动获取焦点 | boolean | false |
|
| autoFocus | 自动获取焦点 | boolean | false | |
|
||||||
| defaultValue | 初始值 | number | |
|
| defaultValue | 初始值 | number | | |
|
||||||
| disabled | 禁用 | boolean | false |
|
| disabled | 禁用 | boolean | false | |
|
||||||
| formatter | 指定输入框展示值的格式 | function(value: number \| string): string | - |
|
| formatter | 指定输入框展示值的格式 | function(value: number \| string): string | - | |
|
||||||
| max | 最大值 | number | Infinity |
|
| max | 最大值 | number | Infinity | |
|
||||||
| min | 最小值 | number | -Infinity |
|
| min | 最小值 | number | -Infinity | |
|
||||||
| parser | 指定从 formatter 里转换回数字的方式,和 formatter 搭配使用 | function( string): number | - |
|
| parser | 指定从 formatter 里转换回数字的方式,和 formatter 搭配使用 | function( string): number | - | |
|
||||||
| precision | 数值精度 | number | - |
|
| precision | 数值精度 | number | - | |
|
||||||
| decimalSeparator | 小数点 | string | - |
|
| decimalSeparator | 小数点 | string | - | 3.10.0 |
|
||||||
| size | 输入框大小 | string | 无 |
|
| size | 输入框大小 | string | 无 | |
|
||||||
| step | 每次改变步数,可以为小数 | number\|string | 1 |
|
| step | 每次改变步数,可以为小数 | number\|string | 1 | |
|
||||||
| value | 当前值 | number | |
|
| value | 当前值 | number | | |
|
||||||
| onChange | 变化回调 | Function(value: number \| string) | |
|
| onChange | 变化回调 | Function(value: number \| string) | | |
|
||||||
|
|
||||||
## 方法
|
## 方法
|
||||||
|
|
||||||
| 名称 | 描述 |
|
| 名称 | 描述 | 版本 |
|
||||||
| ------- | -------- |
|
| ------- | -------- | ---- |
|
||||||
| blur() | 移除焦点 |
|
| blur() | 移除焦点 | |
|
||||||
| focus() | 获取焦点 |
|
| focus() | 获取焦点 | |
|
||||||
|
@ -15,21 +15,21 @@ A basic widget for getting the user input is a text field. Keyboard and mouse ca
|
|||||||
|
|
||||||
### Input
|
### Input
|
||||||
|
|
||||||
| Property | Description | Type | Default |
|
| Property | Description | Type | Default | Version |
|
||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- | --- |
|
||||||
| addonAfter | The label text displayed after (on the right side of) the input field. | string\|ReactNode | |
|
| addonAfter | The label text displayed after (on the right side of) the input field. | string\|ReactNode | | |
|
||||||
| addonBefore | The label text displayed before (on the left side of) the input field. | string\|ReactNode | |
|
| addonBefore | The label text displayed before (on the left side of) the input field. | string\|ReactNode | | |
|
||||||
| defaultValue | The initial input content | string | |
|
| defaultValue | The initial input content | string | | |
|
||||||
| disabled | Whether the input is disabled. | boolean | false |
|
| disabled | Whether the input is disabled. | boolean | false | |
|
||||||
| id | The ID for input | string | |
|
| id | The ID for input | string | | |
|
||||||
| prefix | The prefix icon for the Input. | string\|ReactNode | |
|
| prefix | The prefix icon for the Input. | string\|ReactNode | | |
|
||||||
| size | The size of the input box. Note: in the context of a form, the `large` size is used. Available: `large` `default` `small` | string | `default` |
|
| size | The size of the input box. Note: in the context of a form, the `large` size is used. Available: `large` `default` `small` | string | `default` | |
|
||||||
| suffix | The suffix icon for the Input. | string\|ReactNode | |
|
| suffix | The suffix icon for the Input. | string\|ReactNode | | |
|
||||||
| type | The type of input, see: [MDN](https://developer.mozilla.org/docs/Web/HTML/Element/input#Form_%3Cinput%3E_types)(use `Input.TextArea` instead of `type="textarea"`) | string | `text` |
|
| type | The type of input, see: [MDN](https://developer.mozilla.org/docs/Web/HTML/Element/input#Form_%3Cinput%3E_types)(use `Input.TextArea` instead of `type="textarea"`) | string | `text` | |
|
||||||
| value | The input content value | string | |
|
| value | The input content value | string | | |
|
||||||
| onChange | callback when user input | function(e) | |
|
| onChange | callback when user input | function(e) | | 3.9.3 |
|
||||||
| onPressEnter | The callback function that is triggered when Enter key is pressed. | function(e) | |
|
| onPressEnter | The callback function that is triggered when Enter key is pressed. | function(e) | | |
|
||||||
| allowClear | allow to remove input content with clear icon | boolean | |
|
| allowClear | allow to remove input content with clear icon | boolean | | 3.12.0 |
|
||||||
|
|
||||||
> When `Input` is used in a `Form.Item` context, if the `Form.Item` has the `id` and `options` props defined then `value`, `defaultValue`, and `id` props of `Input` are automatically set.
|
> When `Input` is used in a `Form.Item` context, if the `Form.Item` has the `id` and `options` props defined then `value`, `defaultValue`, and `id` props of `Input` are automatically set.
|
||||||
|
|
||||||
@ -39,12 +39,12 @@ The rest of the props of Input are exactly the same as the original [input](http
|
|||||||
|
|
||||||
> If you are using `antd@<2.12`, please use `Input[type=textarea]`.
|
> If you are using `antd@<2.12`, please use `Input[type=textarea]`.
|
||||||
|
|
||||||
| Property | Description | Type | Default |
|
| Property | Description | Type | Default | Version |
|
||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- | --- |
|
||||||
| autosize | Height autosize feature, can be set to `true|false` or an object `{ minRows: 2, maxRows: 6 }` | boolean\|object | false |
|
| autosize | Height autosize feature, can be set to `true|false` or an object `{ minRows: 2, maxRows: 6 }` | boolean\|object | false | |
|
||||||
| defaultValue | The initial input content | string | |
|
| defaultValue | The initial input content | string | | |
|
||||||
| value | The input content value | string | |
|
| value | The input content value | string | | |
|
||||||
| onPressEnter | The callback function that is triggered when Enter key is pressed. | function(e) | |
|
| onPressEnter | The callback function that is triggered when Enter key is pressed. | function(e) | | |
|
||||||
|
|
||||||
The rest of the props of `Input.TextArea` are the same as the original [textarea](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/textarea).
|
The rest of the props of `Input.TextArea` are the same as the original [textarea](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/textarea).
|
||||||
|
|
||||||
@ -52,19 +52,19 @@ The rest of the props of `Input.TextArea` are the same as the original [textarea
|
|||||||
|
|
||||||
`Added in 2.5.0`
|
`Added in 2.5.0`
|
||||||
|
|
||||||
| Property | Description | Type | Default |
|
| Property | Description | Type | Default | Version |
|
||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- | --- |
|
||||||
| enterButton | to show an enter button after input. This prop is conflict with addon. | boolean\|ReactNode | false |
|
| enterButton | to show an enter button after input. This prop is conflict with addon. | boolean\|ReactNode | false | |
|
||||||
| onSearch | The callback function that is triggered when you click on the search-icon or press Enter key. | function(value, event) | |
|
| onSearch | The callback function that is triggered when you click on the search-icon or press Enter key. | function(value, event) | | |
|
||||||
|
|
||||||
Supports all props of `Input`.
|
Supports all props of `Input`.
|
||||||
|
|
||||||
#### Input.Group
|
#### Input.Group
|
||||||
|
|
||||||
| Property | Description | Type | Default |
|
| Property | Description | Type | Default | Version |
|
||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- | --- |
|
||||||
| compact | Whether use compact style | boolean | false |
|
| compact | Whether use compact style | boolean | false | |
|
||||||
| size | The size of `Input.Group` specifies the size of the included `Input` fields. Available: `large` `default` `small` | string | `default` |
|
| size | The size of `Input.Group` specifies the size of the included `Input` fields. Available: `large` `default` `small` | string | `default` | |
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<Input.Group>
|
<Input.Group>
|
||||||
@ -75,9 +75,9 @@ Supports all props of `Input`.
|
|||||||
|
|
||||||
#### Input.Password (Added in 3.12.0)
|
#### Input.Password (Added in 3.12.0)
|
||||||
|
|
||||||
| Property | Description | Type | Default |
|
| Property | Description | Type | Default | Version |
|
||||||
| ---------------- | -------------------------- | ------- | ------- |
|
| ---------------- | -------------------------- | ------- | ------- | ------- |
|
||||||
| visibilityToggle | Whether show toggle button | boolean | true |
|
| visibilityToggle | Whether show toggle button | boolean | true | 3.12.2 |
|
||||||
|
|
||||||
## FAQ
|
## FAQ
|
||||||
|
|
||||||
|
@ -16,21 +16,21 @@ title: Input
|
|||||||
|
|
||||||
### Input
|
### Input
|
||||||
|
|
||||||
| 参数 | 说明 | 类型 | 默认值 |
|
| 参数 | 说明 | 类型 | 默认值 | 版本 |
|
||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- | --- |
|
||||||
| addonAfter | 带标签的 input,设置后置标签 | string\|ReactNode | |
|
| addonAfter | 带标签的 input,设置后置标签 | string\|ReactNode | | |
|
||||||
| addonBefore | 带标签的 input,设置前置标签 | string\|ReactNode | |
|
| addonBefore | 带标签的 input,设置前置标签 | string\|ReactNode | | |
|
||||||
| defaultValue | 输入框默认内容 | string | |
|
| defaultValue | 输入框默认内容 | string | | |
|
||||||
| disabled | 是否禁用状态,默认为 false | boolean | false |
|
| disabled | 是否禁用状态,默认为 false | boolean | false | |
|
||||||
| id | 输入框的 id | string | |
|
| id | 输入框的 id | string | | |
|
||||||
| prefix | 带有前缀图标的 input | string\|ReactNode | |
|
| prefix | 带有前缀图标的 input | string\|ReactNode | | |
|
||||||
| size | 控件大小。注:标准表单内的输入框大小限制为 `large`。可选 `large` `default` `small` | string | `default` |
|
| size | 控件大小。注:标准表单内的输入框大小限制为 `large`。可选 `large` `default` `small` | string | `default` | |
|
||||||
| suffix | 带有后缀图标的 input | string\|ReactNode | |
|
| suffix | 带有后缀图标的 input | string\|ReactNode | | |
|
||||||
| type | 声明 input 类型,同原生 input 标签的 type 属性,见:[MDN](https://developer.mozilla.org/zh-CN/docs/Web/HTML/Element/input#属性)(请直接使用 `Input.TextArea` 代替 `type="textarea"`)。 | string | `text` |
|
| type | 声明 input 类型,同原生 input 标签的 type 属性,见:[MDN](https://developer.mozilla.org/zh-CN/docs/Web/HTML/Element/input#属性)(请直接使用 `Input.TextArea` 代替 `type="textarea"`)。 | string | `text` | |
|
||||||
| value | 输入框内容 | string | |
|
| value | 输入框内容 | string | | |
|
||||||
| onChange | 输入框内容变化时的回调 | function(e) | |
|
| onChange | 输入框内容变化时的回调 | function(e) | | 3.9.3 |
|
||||||
| onPressEnter | 按下回车的回调 | function(e) | |
|
| onPressEnter | 按下回车的回调 | function(e) | | |
|
||||||
| allowClear | 可以点击清除图标删除内容 | boolean | |
|
| allowClear | 可以点击清除图标删除内容 | boolean | | 3.12.0 |
|
||||||
|
|
||||||
> 如果 `Input` 在 `Form.Item` 内,并且 `Form.Item` 设置了 `id` 和 `options` 属性,则 `value` `defaultValue` 和 `id` 属性会被自动设置。
|
> 如果 `Input` 在 `Form.Item` 内,并且 `Form.Item` 设置了 `id` 和 `options` 属性,则 `value` `defaultValue` 和 `id` 属性会被自动设置。
|
||||||
|
|
||||||
@ -40,30 +40,30 @@ Input 的其他属性和 React 自带的 [input](https://facebook.github.io/reac
|
|||||||
|
|
||||||
> `2.12` 后新增的组件,旧版请使用 `Input[type=textarea]`。
|
> `2.12` 后新增的组件,旧版请使用 `Input[type=textarea]`。
|
||||||
|
|
||||||
| 参数 | 说明 | 类型 | 默认值 |
|
| 参数 | 说明 | 类型 | 默认值 | 版本 |
|
||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- | --- |
|
||||||
| autosize | 自适应内容高度,可设置为 `true|false` 或对象:`{ minRows: 2, maxRows: 6 }` | boolean\|object | false |
|
| autosize | 自适应内容高度,可设置为 `true|false` 或对象:`{ minRows: 2, maxRows: 6 }` | boolean\|object | false | |
|
||||||
| defaultValue | 输入框默认内容 | string | |
|
| defaultValue | 输入框默认内容 | string | | |
|
||||||
| value | 输入框内容 | string | |
|
| value | 输入框内容 | string | | |
|
||||||
| onPressEnter | 按下回车的回调 | function(e) | |
|
| onPressEnter | 按下回车的回调 | function(e) | | |
|
||||||
|
|
||||||
`Input.TextArea` 的其他属性和浏览器自带的 [textarea](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/textarea) 一致。
|
`Input.TextArea` 的其他属性和浏览器自带的 [textarea](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/textarea) 一致。
|
||||||
|
|
||||||
#### Input.Search
|
#### Input.Search
|
||||||
|
|
||||||
| 参数 | 说明 | 类型 | 默认值 |
|
| 参数 | 说明 | 类型 | 默认值 | 版本 |
|
||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- | --- |
|
||||||
| enterButton | 是否有确认按钮,可设为按钮文字。该属性会与 addon 冲突。 | boolean\|ReactNode | false |
|
| enterButton | 是否有确认按钮,可设为按钮文字。该属性会与 addon 冲突。 | boolean\|ReactNode | false | |
|
||||||
| onSearch | 点击搜索或按下回车键时的回调 | function(value, event) | |
|
| onSearch | 点击搜索或按下回车键时的回调 | function(value, event) | | |
|
||||||
|
|
||||||
其余属性和 Input 一致。
|
其余属性和 Input 一致。
|
||||||
|
|
||||||
#### Input.Group
|
#### Input.Group
|
||||||
|
|
||||||
| 参数 | 说明 | 类型 | 默认值 |
|
| 参数 | 说明 | 类型 | 默认值 | 版本 |
|
||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- | --- |
|
||||||
| compact | 是否用紧凑模式 | boolean | false |
|
| compact | 是否用紧凑模式 | boolean | false | |
|
||||||
| size | `Input.Group` 中所有的 `Input` 的大小,可选 `large` `default` `small` | string | `default` |
|
| size | `Input.Group` 中所有的 `Input` 的大小,可选 `large` `default` `small` | string | `default` | |
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<Input.Group>
|
<Input.Group>
|
||||||
@ -74,9 +74,9 @@ Input 的其他属性和 React 自带的 [input](https://facebook.github.io/reac
|
|||||||
|
|
||||||
#### Input.Password (3.12.0 中新增)
|
#### Input.Password (3.12.0 中新增)
|
||||||
|
|
||||||
| 参数 | 说明 | 类型 | 默认值 |
|
| 参数 | 说明 | 类型 | 默认值 | 版本 |
|
||||||
| ---------------- | ---------------- | ------- | ------ |
|
| ---------------- | ---------------- | ------- | ------ | ------ |
|
||||||
| visibilityToggle | 是否显示切换按钮 | boolean | true |
|
| visibilityToggle | 是否显示切换按钮 | boolean | true | 3.12.2 |
|
||||||
|
|
||||||
## FAQ
|
## FAQ
|
||||||
|
|
||||||
|
@ -73,11 +73,11 @@ Style of a navigation should conform to its level.
|
|||||||
|
|
||||||
The wrapper.
|
The wrapper.
|
||||||
|
|
||||||
| Property | Description | Type | Default |
|
| Property | Description | Type | Default | Version |
|
||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- | --- |
|
||||||
| className | container className | string | - |
|
| className | container className | string | - | |
|
||||||
| hasSider | whether contain Sider in children, don't have to assign it normally. Useful in ssr avoid style flickering | boolean | - |
|
| hasSider | whether contain Sider in children, don't have to assign it normally. Useful in ssr avoid style flickering | boolean | - | 3.2.0 |
|
||||||
| style | to customize the styles | object | - |
|
| style | to customize the styles | object | - | |
|
||||||
|
|
||||||
> APIs of `Layout.Header` `Layout.Footer` `Layout.Content` are the same as that of `Layout`.
|
> APIs of `Layout.Header` `Layout.Footer` `Layout.Content` are the same as that of `Layout`.
|
||||||
|
|
||||||
@ -85,21 +85,21 @@ The wrapper.
|
|||||||
|
|
||||||
The sidebar.
|
The sidebar.
|
||||||
|
|
||||||
| Property | Description | Type | Default |
|
| Property | Description | Type | Default | Version |
|
||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- | --- |
|
||||||
| breakpoint | [breakpoints](/components/grid#api) of the responsive layout | Enum { 'xs', 'sm', 'md', 'lg', 'xl', 'xxl' } | - |
|
| breakpoint | [breakpoints](/components/grid#api) of the responsive layout | Enum { 'xs', 'sm', 'md', 'lg', 'xl', 'xxl' } | - | |
|
||||||
| className | container className | string | - |
|
| className | container className | string | - | |
|
||||||
| collapsed | to set the current status | boolean | - |
|
| collapsed | to set the current status | boolean | - | |
|
||||||
| collapsedWidth | width of the collapsed sidebar, by setting to `0` a special trigger will appear | number | 80 |
|
| collapsedWidth | width of the collapsed sidebar, by setting to `0` a special trigger will appear | number | 80 | |
|
||||||
| collapsible | whether can be collapsed | boolean | false |
|
| collapsible | whether can be collapsed | boolean | false | |
|
||||||
| defaultCollapsed | to set the initial status | boolean | false |
|
| defaultCollapsed | to set the initial status | boolean | false | |
|
||||||
| reverseArrow | reverse direction of arrow, for a sider that expands from the right | boolean | false |
|
| reverseArrow | reverse direction of arrow, for a sider that expands from the right | boolean | false | |
|
||||||
| style | to customize the styles | object | - |
|
| style | to customize the styles | object | - | |
|
||||||
| theme | color theme of the sidebar | string: `light` `dark` | `dark` |
|
| theme | color theme of the sidebar | string: `light` `dark` | `dark` | 3.6.0 |
|
||||||
| trigger | specify the customized trigger, set to null to hide the trigger | string\|ReactNode | - |
|
| trigger | specify the customized trigger, set to null to hide the trigger | string\|ReactNode | - | |
|
||||||
| width | width of the sidebar | number\|string | 200 |
|
| width | width of the sidebar | number\|string | 200 | |
|
||||||
| onCollapse | the callback function, executed by clicking the trigger or activating the responsive layout | (collapsed, type) => {} | - |
|
| onCollapse | the callback function, executed by clicking the trigger or activating the responsive layout | (collapsed, type) => {} | - | |
|
||||||
| onBreakpoint | the callback function, executed when [breakpoints](/components/grid#api) changed | (broken) => {} | - |
|
| onBreakpoint | the callback function, executed when [breakpoints](/components/grid#api) changed | (broken) => {} | - | 3.7.0 |
|
||||||
|
|
||||||
#### breakpoint width
|
#### breakpoint width
|
||||||
|
|
||||||
|
@ -74,11 +74,11 @@ title: Layout
|
|||||||
|
|
||||||
布局容器。
|
布局容器。
|
||||||
|
|
||||||
| 参数 | 说明 | 类型 | 默认值 |
|
| 参数 | 说明 | 类型 | 默认值 | 版本 |
|
||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- | --- |
|
||||||
| className | 容器 className | string | - |
|
| className | 容器 className | string | - | |
|
||||||
| hasSider | 表示子元素里有 Sider,一般不用指定。可用于服务端渲染时避免样式闪动 | boolean | - |
|
| hasSider | 表示子元素里有 Sider,一般不用指定。可用于服务端渲染时避免样式闪动 | boolean | - | 3.2.0 |
|
||||||
| style | 指定样式 | object | - |
|
| style | 指定样式 | object | - | |
|
||||||
|
|
||||||
> `Layout.Header` `Layout.Footer` `Layout.Content` API 与 `Layout` 相同
|
> `Layout.Header` `Layout.Footer` `Layout.Content` API 与 `Layout` 相同
|
||||||
|
|
||||||
@ -86,21 +86,21 @@ title: Layout
|
|||||||
|
|
||||||
侧边栏。
|
侧边栏。
|
||||||
|
|
||||||
| 参数 | 说明 | 类型 | 默认值 |
|
| 参数 | 说明 | 类型 | 默认值 | 版本 |
|
||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- | --- |
|
||||||
| breakpoint | 触发响应式布局的[断点](/components/grid#api) | Enum { 'xs', 'sm', 'md', 'lg', 'xl', 'xxl' } | - |
|
| breakpoint | 触发响应式布局的[断点](/components/grid#api) | Enum { 'xs', 'sm', 'md', 'lg', 'xl', 'xxl' } | - | |
|
||||||
| className | 容器 className | string | - |
|
| className | 容器 className | string | - | |
|
||||||
| collapsed | 当前收起状态 | boolean | - |
|
| collapsed | 当前收起状态 | boolean | - | |
|
||||||
| collapsedWidth | 收缩宽度,设置为 0 会出现特殊 trigger | number | 80 |
|
| collapsedWidth | 收缩宽度,设置为 0 会出现特殊 trigger | number | 80 | |
|
||||||
| collapsible | 是否可收起 | boolean | false |
|
| collapsible | 是否可收起 | boolean | false | |
|
||||||
| defaultCollapsed | 是否默认收起 | boolean | false |
|
| defaultCollapsed | 是否默认收起 | boolean | false | |
|
||||||
| reverseArrow | 翻转折叠提示箭头的方向,当 Sider 在右边时可以使用 | boolean | false |
|
| reverseArrow | 翻转折叠提示箭头的方向,当 Sider 在右边时可以使用 | boolean | false | |
|
||||||
| style | 指定样式 | object | - |
|
| style | 指定样式 | object | - | |
|
||||||
| theme | 主题颜色 | string: `light` `dark` | `dark` |
|
| theme | 主题颜色 | string: `light` `dark` | `dark` | 3.6.0 |
|
||||||
| trigger | 自定义 trigger,设置为 null 时隐藏 trigger | string\|ReactNode | - |
|
| trigger | 自定义 trigger,设置为 null 时隐藏 trigger | string\|ReactNode | - | |
|
||||||
| width | 宽度 | number\|string | 200 |
|
| width | 宽度 | number\|string | 200 | |
|
||||||
| onCollapse | 展开-收起时的回调函数,有点击 trigger 以及响应式反馈两种方式可以触发 | (collapsed, type) => {} | - |
|
| onCollapse | 展开-收起时的回调函数,有点击 trigger 以及响应式反馈两种方式可以触发 | (collapsed, type) => {} | - | |
|
||||||
| onBreakpoint | 触发响应式布局[断点](/components/grid#api)时的回调 | (broken) => {} | - |
|
| onBreakpoint | 触发响应式布局[断点](/components/grid#api)时的回调 | (broken) => {} | - | 3.7.0 |
|
||||||
|
|
||||||
#### breakpoint width
|
#### breakpoint width
|
||||||
|
|
||||||
|
@ -15,21 +15,21 @@ A list can be used to display content related to a single subject. The content c
|
|||||||
|
|
||||||
### List
|
### List
|
||||||
|
|
||||||
| Property | Description | Type | Default |
|
| Property | Description | Type | Default | Version |
|
||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- | --- |
|
||||||
| bordered | Toggles rendering of the border around the list | boolean | false |
|
| bordered | Toggles rendering of the border around the list | boolean | false | |
|
||||||
| footer | List footer renderer | string\|ReactNode | - |
|
| footer | List footer renderer | string\|ReactNode | - | |
|
||||||
| grid | The grid type of list. You can set grid to something like {gutter: 16, column: 4} | object | - |
|
| grid | The grid type of list. You can set grid to something like {gutter: 16, column: 4} | object | - | |
|
||||||
| header | List header renderer | string\|ReactNode | - |
|
| header | List header renderer | string\|ReactNode | - | |
|
||||||
| itemLayout | The layout of list, default is `horizontal`, If a vertical list is desired, set the itemLayout property to `vertical` | string | - |
|
| itemLayout | The layout of list, default is `horizontal`, If a vertical list is desired, set the itemLayout property to `vertical` | string | - | |
|
||||||
| rowKey | Item's unique key, could be a string or function that returns a string | string\|Function(record):string | `key` |
|
| rowKey | Item's unique key, could be a string or function that returns a string | string\|Function(record):string | `key` | 3.12.0 |
|
||||||
| loading | Shows a loading indicator while the contents of the list are being fetched | boolean\|[object](https://ant.design/components/spin-cn/#API) ([more](https://github.com/ant-design/ant-design/issues/8659)) | false |
|
| loading | Shows a loading indicator while the contents of the list are being fetched | boolean\|[object](https://ant.design/components/spin-cn/#API) ([more](https://github.com/ant-design/ant-design/issues/8659)) | false | |
|
||||||
| loadMore | Shows a load more content | string\|ReactNode | - |
|
| loadMore | Shows a load more content | string\|ReactNode | - | |
|
||||||
| locale | i18n text including empty text | object | emptyText: 'No Data' <br> |
|
| locale | i18n text including empty text | object | emptyText: 'No Data' <br> | 3.4.2 |
|
||||||
| pagination | Pagination [config](https://ant.design/components/pagination/), hide it by setting it to false | boolean \| object | false |
|
| pagination | Pagination [config](https://ant.design/components/pagination/), hide it by setting it to false | boolean \| object | false | |
|
||||||
| split | Toggles rendering of the split under the list item | boolean | true |
|
| split | Toggles rendering of the split under the list item | boolean | true | |
|
||||||
| dataSource | dataSource array for list | any[] | - |
|
| dataSource | dataSource array for list | any[] | - | 3.20.1 |
|
||||||
| renderItem | customize list item when using `dataSource` | `item => ReactNode` | - |
|
| renderItem | customize list item when using `dataSource` | `item => ReactNode` | - | 3.20.1 |
|
||||||
|
|
||||||
### pagination
|
### pagination
|
||||||
|
|
||||||
@ -37,35 +37,35 @@ Properties for pagination.
|
|||||||
|
|
||||||
| Property | Description | Type | Default |
|
| Property | Description | Type | Default |
|
||||||
| -------- | ------------------------------------ | --------------------------- | -------- |
|
| -------- | ------------------------------------ | --------------------------- | -------- |
|
||||||
| position | specify the position of `Pagination` | 'top' \| 'bottom' \| 'both' | 'bottom' |
|
| position | specify the position of `Pagination` | 'top' \| 'bottom' \| 'both' | 'bottom' | 3.6.0 |
|
||||||
|
|
||||||
More about pagination, please check [`Pagination`](/components/pagination/).
|
More about pagination, please check [`Pagination`](/components/pagination/).
|
||||||
|
|
||||||
### List grid props
|
### List grid props
|
||||||
|
|
||||||
| Property | Description | Type | Default |
|
| Property | Description | Type | Default | Version |
|
||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- | --- |
|
||||||
| column | column of grid, [optional number](https://github.com/ant-design/ant-design/blob/a7f17b4cdebbca07b3b9ce5698de61e772d46237/components/list/index.tsx#L16) | number | - |
|
| column | column of grid, [optional number](https://github.com/ant-design/ant-design/blob/a7f17b4cdebbca07b3b9ce5698de61e772d46237/components/list/index.tsx#L16) | number | - | |
|
||||||
| gutter | spacing between grid | number | 0 |
|
| gutter | spacing between grid | number | 0 | |
|
||||||
| size | Size of list | `default` \| `middle` \| `small` | `default` |
|
| size | Size of list | `default` \| `middle` \| `small` | `default` | |
|
||||||
| xs | `<576px` column of grid | number | - |
|
| xs | `<576px` column of grid | number | - | |
|
||||||
| sm | `≥576px` column of grid | number | - |
|
| sm | `≥576px` column of grid | number | - | |
|
||||||
| md | `≥768px` column of grid | number | - |
|
| md | `≥768px` column of grid | number | - | |
|
||||||
| lg | `≥992px` column of grid | number | - |
|
| lg | `≥992px` column of grid | number | - | |
|
||||||
| xl | `≥1200px` column of grid | number | - |
|
| xl | `≥1200px` column of grid | number | - | |
|
||||||
| xxl | `≥1600px` column of grid | number | - |
|
| xxl | `≥1600px` column of grid | number | - | |
|
||||||
|
|
||||||
### List.Item
|
### List.Item
|
||||||
|
|
||||||
| Property | Description | Type | Default |
|
| Property | Description | Type | Default | Version |
|
||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- | --- |
|
||||||
| actions | The actions content of list item. If `itemLayout` is `vertical`, shows the content on bottom, otherwise shows content on the far right. | Array<ReactNode> | - |
|
| actions | The actions content of list item. If `itemLayout` is `vertical`, shows the content on bottom, otherwise shows content on the far right. | Array<ReactNode> | - | |
|
||||||
| extra | The extra content of list item. If `itemLayout` is `vertical`, shows the content on right, otherwise shows content on the far right. | string\|ReactNode | - |
|
| extra | The extra content of list item. If `itemLayout` is `vertical`, shows the content on right, otherwise shows content on the far right. | string\|ReactNode | - | |
|
||||||
|
|
||||||
### List.Item.Meta
|
### List.Item.Meta
|
||||||
|
|
||||||
| Property | Description | Type | Default |
|
| Property | Description | Type | Default | Version |
|
||||||
| ----------- | ---------------------------- | ----------------- | ------- |
|
| ----------- | ---------------------------- | ----------------- | ------- | ------- |
|
||||||
| avatar | The avatar of list item | ReactNode | - |
|
| avatar | The avatar of list item | ReactNode | - | |
|
||||||
| description | The description of list item | string\|ReactNode | - |
|
| description | The description of list item | string\|ReactNode | - | |
|
||||||
| title | The title of list item | string\|ReactNode | - |
|
| title | The title of list item | string\|ReactNode | - | |
|
||||||
|
@ -16,21 +16,21 @@ cols: 1
|
|||||||
|
|
||||||
### List
|
### List
|
||||||
|
|
||||||
| 参数 | 说明 | 类型 | 默认值 |
|
| 参数 | 说明 | 类型 | 默认值 | 版本 |
|
||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- | --- |
|
||||||
| bordered | 是否展示边框 | boolean | false |
|
| bordered | 是否展示边框 | boolean | false | |
|
||||||
| footer | 列表底部 | string\|ReactNode | - |
|
| footer | 列表底部 | string\|ReactNode | - | |
|
||||||
| grid | 列表栅格配置 | object | - |
|
| grid | 列表栅格配置 | object | - | |
|
||||||
| header | 列表头部 | string\|ReactNode | - |
|
| header | 列表头部 | string\|ReactNode | - | |
|
||||||
| itemLayout | 设置 `List.Item` 布局, 设置成 `vertical` 则竖直样式显示, 默认横排 | string | - |
|
| itemLayout | 设置 `List.Item` 布局, 设置成 `vertical` 则竖直样式显示, 默认横排 | string | - | |
|
||||||
| loading | 当卡片内容还在加载中时,可以用 `loading` 展示一个占位 | boolean\|[object](https://ant.design/components/spin-cn/#API) ([更多](https://github.com/ant-design/ant-design/issues/8659)) | false |
|
| loading | 当卡片内容还在加载中时,可以用 `loading` 展示一个占位 | boolean\|[object](https://ant.design/components/spin-cn/#API) ([更多](https://github.com/ant-design/ant-design/issues/8659)) | false | |
|
||||||
| loadMore | 加载更多 | string\|ReactNode | - |
|
| loadMore | 加载更多 | string\|ReactNode | - | |
|
||||||
| locale | 默认文案设置,目前包括空数据文案 | object | emptyText: '暂无数据' |
|
| locale | 默认文案设置,目前包括空数据文案 | object | emptyText: '暂无数据' | 3.4.2 |
|
||||||
| pagination | 对应的 `pagination` 配置, 设置 `false` 不显示 | boolean\|object | false |
|
| pagination | 对应的 `pagination` 配置, 设置 `false` 不显示 | boolean\|object | false | |
|
||||||
| size | list 的尺寸 | `default` \| `middle` \| `small` | `default` |
|
| size | list 的尺寸 | `default` \| `middle` \| `small` | `default` | |
|
||||||
| split | 是否展示分割线 | boolean | true |
|
| split | 是否展示分割线 | boolean | true | |
|
||||||
| dataSource | 列表数据源 | any[] | - |
|
| dataSource | 列表数据源 | any[] | - | 3.20.1 |
|
||||||
| renderItem | 当使用 dataSource 时,可以用 `renderItem` 自定义渲染列表项 | `item => ReactNode` | - |
|
| renderItem | 当使用 dataSource 时,可以用 `renderItem` 自定义渲染列表项 | `item => ReactNode` | - | 3.20.1 |
|
||||||
|
|
||||||
### pagination
|
### pagination
|
||||||
|
|
||||||
@ -38,34 +38,34 @@ cols: 1
|
|||||||
|
|
||||||
| 参数 | 说明 | 类型 | 默认值 |
|
| 参数 | 说明 | 类型 | 默认值 |
|
||||||
| -------- | ------------------ | --------------------------- | -------- |
|
| -------- | ------------------ | --------------------------- | -------- |
|
||||||
| position | 指定分页显示的位置 | 'top' \| 'bottom' \| 'both' | 'bottom' |
|
| position | 指定分页显示的位置 | 'top' \| 'bottom' \| 'both' | 'bottom' | 3.6.0 |
|
||||||
|
|
||||||
更多配置项,请查看 [`Pagination`](/components/pagination/)。
|
更多配置项,请查看 [`Pagination`](/components/pagination/)。
|
||||||
|
|
||||||
### List grid props
|
### List grid props
|
||||||
|
|
||||||
| 参数 | 说明 | 类型 | 默认值 |
|
| 参数 | 说明 | 类型 | 默认值 | 版本 |
|
||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- | --- |
|
||||||
| column | 列数,[可选值](https://github.com/ant-design/ant-design/blob/a7f17b4cdebbca07b3b9ce5698de61e772d46237/components/list/index.tsx#L16) | number | - |
|
| column | 列数,[可选值](https://github.com/ant-design/ant-design/blob/a7f17b4cdebbca07b3b9ce5698de61e772d46237/components/list/index.tsx#L16) | number | - | |
|
||||||
| gutter | 栅格间隔 | number | 0 |
|
| gutter | 栅格间隔 | number | 0 | |
|
||||||
| xs | `<576px` 展示的列数 | number | - |
|
| xs | `<576px` 展示的列数 | number | - | |
|
||||||
| sm | `≥576px` 展示的列数 | number | - |
|
| sm | `≥576px` 展示的列数 | number | - | |
|
||||||
| md | `≥768px` 展示的列数 | number | - |
|
| md | `≥768px` 展示的列数 | number | - | |
|
||||||
| lg | `≥992px` 展示的列数 | number | - |
|
| lg | `≥992px` 展示的列数 | number | - | |
|
||||||
| xl | `≥1200px` 展示的列数 | number | - |
|
| xl | `≥1200px` 展示的列数 | number | - | |
|
||||||
| xxl | `≥1600px` 展示的列数 | number | - |
|
| xxl | `≥1600px` 展示的列数 | number | - | |
|
||||||
|
|
||||||
### List.Item
|
### List.Item
|
||||||
|
|
||||||
| 参数 | 说明 | 类型 | 默认值 |
|
| 参数 | 说明 | 类型 | 默认值 | 版本 |
|
||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- | --- |
|
||||||
| actions | 列表操作组,根据 `itemLayout` 的不同, 位置在卡片底部或者最右侧 | Array<ReactNode> | - |
|
| actions | 列表操作组,根据 `itemLayout` 的不同, 位置在卡片底部或者最右侧 | Array<ReactNode> | - | |
|
||||||
| extra | 额外内容, 通常用在 `itemLayout` 为 `vertical` 的情况下, 展示右侧内容; `horizontal` 展示在列表元素最右侧 | string\|ReactNode | - |
|
| extra | 额外内容, 通常用在 `itemLayout` 为 `vertical` 的情况下, 展示右侧内容; `horizontal` 展示在列表元素最右侧 | string\|ReactNode | - | |
|
||||||
|
|
||||||
### List.Item.Meta
|
### List.Item.Meta
|
||||||
|
|
||||||
| 参数 | 说明 | 类型 | 默认值 |
|
| 参数 | 说明 | 类型 | 默认值 | 版本 |
|
||||||
| ----------- | ------------------ | ----------------- | ------ |
|
| ----------- | ------------------ | ----------------- | ------ | ---- |
|
||||||
| avatar | 列表元素的图标 | ReactNode | - |
|
| avatar | 列表元素的图标 | ReactNode | - | |
|
||||||
| description | 列表元素的描述内容 | string\|ReactNode | - |
|
| description | 列表元素的描述内容 | string\|ReactNode | - | |
|
||||||
| title | 列表元素的标题 | string\|ReactNode | - |
|
| title | 列表元素的标题 | string\|ReactNode | - | |
|
||||||
|
@ -45,9 +45,9 @@ This component aims to provide localization of the built-in text. If you want to
|
|||||||
|
|
||||||
## API
|
## API
|
||||||
|
|
||||||
| Property | Description | Type | Default |
|
| Property | Description | Type | Default | Version |
|
||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- | --- |
|
||||||
| locale | language package setting, you can find the packages in [antd/lib/locale-provider](http://unpkg.com/antd/lib/locale-provider/) | object | - |
|
| locale | language package setting, you can find the packages in [antd/lib/locale-provider](http://unpkg.com/antd/lib/locale-provider/) | object | - | |
|
||||||
|
|
||||||
## FAQ
|
## FAQ
|
||||||
|
|
||||||
|
@ -46,9 +46,9 @@ return <LocaleProvider locale={locales.en_US}><App /></LocaleProvider>;
|
|||||||
|
|
||||||
## API
|
## API
|
||||||
|
|
||||||
| 参数 | 说明 | 类型 | 默认值 |
|
| 参数 | 说明 | 类型 | 默认值 | 版本 |
|
||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- | --- |
|
||||||
| locale | 语言包配置,语言包可到 [antd/lib/locale-provider](http://unpkg.com/antd/lib/locale-provider/) 目录下寻找 | object | - |
|
| locale | 语言包配置,语言包可到 [antd/lib/locale-provider](http://unpkg.com/antd/lib/locale-provider/) 目录下寻找 | object | - | |
|
||||||
|
|
||||||
## FAQ
|
## FAQ
|
||||||
|
|
||||||
|
@ -25,47 +25,47 @@ to measure tips position, which use nearly 11.6% package size. We hope to reduce
|
|||||||
|
|
||||||
### Mention API
|
### Mention API
|
||||||
|
|
||||||
| API | Description | Type |
|
| API | Description | Type | Version |
|
||||||
| --- | --- | --- |
|
| --- | --- | --- | --- |
|
||||||
| getMentions | get mentioned people in current contentState | Function(ContentState: contentState): string\[] |
|
| getMentions | get mentioned people in current contentState | Function(ContentState: contentState): string\[] | |
|
||||||
| toContentState | convert string to ContentState | Function(value: string): ContentState |
|
| toContentState | convert string to ContentState | Function(value: string): ContentState | |
|
||||||
| toString | convert ContentState to string | Function(contentState: ContentState): string |
|
| toString | convert ContentState to string | Function(contentState: ContentState): string | |
|
||||||
|
|
||||||
### Mention
|
### Mention
|
||||||
|
|
||||||
| Property | Description | Type | Default |
|
| Property | Description | Type | Default | Version |
|
||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- | --- |
|
||||||
| autoFocus | get focus when component mounted | boolean | false |
|
| autoFocus | get focus when component mounted | boolean | false | |
|
||||||
| defaultValue | default value | ContentState, you can use `Mention.toContentState` to convert text to `ContentState` | null |
|
| defaultValue | default value | ContentState, you can use `Mention.toContentState` to convert text to `ContentState` | null | |
|
||||||
| defaultSuggestions | default suggestion content | Array<string\|Mention.Nav> | \[] |
|
| defaultSuggestions | default suggestion content | Array<string\|Mention.Nav> | \[] | 3.12.0 |
|
||||||
| disabled | Tell if the input is disabled. | boolean | false |
|
| disabled | Tell if the input is disabled. | boolean | false | |
|
||||||
| getSuggestionContainer | rendered to the root of the menu. Default rendered to the body dom. If gets any problem of the menu while scrolling. Try to make the root the dom scrolled, and make it position relative. | function | () => document.body |
|
| getSuggestionContainer | rendered to the root of the menu. Default rendered to the body dom. If gets any problem of the menu while scrolling. Try to make the root the dom scrolled, and make it position relative. | function | () => document.body | |
|
||||||
| loading | loading mode | boolean | false |
|
| loading | loading mode | boolean | false | |
|
||||||
| multiLines | multilines mode | boolean | false |
|
| multiLines | multilines mode | boolean | false | |
|
||||||
| notFoundContent | suggestion when suggestions empty | string | 'No matches found' |
|
| notFoundContent | suggestion when suggestions empty | string | 'No matches found' | |
|
||||||
| placeholder | placeholder of input | string | null |
|
| placeholder | placeholder of input | string | null | |
|
||||||
| placement | The position of the suggestion relative to the target, which can be one of `top` and `bottom` | string | 'bottom'. |
|
| placement | The position of the suggestion relative to the target, which can be one of `top` and `bottom` | string | 'bottom'. | |
|
||||||
| prefix | character which will trigger Mention to show mention list | string or Array<string> | '@' |
|
| prefix | character which will trigger Mention to show mention list | string or Array<string> | '@' | |
|
||||||
| readOnly | Tell if the input is readonly. | boolean | false |
|
| readOnly | Tell if the input is readonly. | boolean | false | |
|
||||||
| suggestions | suggestion content | Array<string\|Mention.Nav> | \[] |
|
| suggestions | suggestion content | Array<string\|Mention.Nav> | \[] | |
|
||||||
| suggestionStyle | style of suggestion container | object | {} |
|
| suggestionStyle | style of suggestion container | object | {} | |
|
||||||
| value | core state of mention | ContentState | null |
|
| value | core state of mention | ContentState | null | |
|
||||||
| onBlur | Callback function called when mention component blur | function(e) | null |
|
| onBlur | Callback function called when mention component blur | function(e) | null | |
|
||||||
| onChange | Callback function called when content of input changes | function(contentState: ContentState) | null |
|
| onChange | Callback function called when content of input changes | function(contentState: ContentState) | null | |
|
||||||
| onFocus | Callback function called when mention component get focus | function | null |
|
| onFocus | Callback function called when mention component get focus | function | null | |
|
||||||
| onSearchChange | Callback function called when search content changes | function(value:string, trigger: string) | \[] |
|
| onSearchChange | Callback function called when search content changes | function(value:string, trigger: string) | \[] | |
|
||||||
| onSelect | Callback function called when select from suggestions | function(suggestion: string, data?: any) | null |
|
| onSelect | Callback function called when select from suggestions | function(suggestion: string, data?: any) | null | |
|
||||||
|
|
||||||
### Mention methods
|
### Mention methods
|
||||||
|
|
||||||
| Name | Description |
|
| Name | Description | Version |
|
||||||
| ------- | ------------ |
|
| ------- | ------------ | ------- |
|
||||||
| blur() | remove focus |
|
| blur() | remove focus | |
|
||||||
| focus() | get focus |
|
| focus() | get focus | |
|
||||||
|
|
||||||
### Nav
|
### Nav
|
||||||
|
|
||||||
| Property | Description | Type | Default |
|
| Property | Description | Type | Default | Version |
|
||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- | --- |
|
||||||
| children | suggestion content | object | {} |
|
| children | suggestion content | object | {} | |
|
||||||
| value | value of suggestion, the value will insert into input filed while selected | string | "" |
|
| value | value of suggestion, the value will insert into input filed while selected | string | "" | |
|
||||||
|
@ -26,47 +26,47 @@ Mention 组件使用了
|
|||||||
|
|
||||||
### Mention API
|
### Mention API
|
||||||
|
|
||||||
| API | 说明 | 类型 |
|
| API | 说明 | 类型 | 版本 |
|
||||||
| --- | --- | --- |
|
| --- | --- | --- | --- |
|
||||||
| getMentions | 获取当前 contentState 中提到的人的列表 | Function(contentState: ContentState): string\[] |
|
| getMentions | 获取当前 contentState 中提到的人的列表 | Function(contentState: ContentState): string\[] | |
|
||||||
| toContentState | 把字符串转成 ContentState | Function(value: string): ContentState |
|
| toContentState | 把字符串转成 ContentState | Function(value: string): ContentState | |
|
||||||
| toString | 把 ContentState 转成字符串 | Function(contentState: ContentState): string |
|
| toString | 把 ContentState 转成字符串 | Function(contentState: ContentState): string | |
|
||||||
|
|
||||||
### Mention
|
### Mention
|
||||||
|
|
||||||
| 参数 | 说明 | 类型 | 默认值 |
|
| 参数 | 说明 | 类型 | 默认值 | 版本 |
|
||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- | --- |
|
||||||
| autoFocus | 自动获取焦点 | boolean | false |
|
| autoFocus | 自动获取焦点 | boolean | false | |
|
||||||
| defaultValue | 默认值 | ContentState, 可以用 `Mention.toContentState(text)` 把文字转换成 ContentState | null |
|
| defaultValue | 默认值 | ContentState, 可以用 `Mention.toContentState(text)` 把文字转换成 ContentState | null | |
|
||||||
| defaultSuggestions | 默认建议内容 | Array<string\|Mention.Nav> | \[] |
|
| defaultSuggestions | 默认建议内容 | Array<string\|Mention.Nav> | \[] | 3.12.0 |
|
||||||
| disabled | 是否禁用状态. | boolean | false |
|
| disabled | 是否禁用状态. | boolean | false | |
|
||||||
| getSuggestionContainer | 菜单渲染父节点。默认渲染到 body 上,如果你遇到菜单滚动定位问题,试试修改为滚动的区域,并相对其定位 | function() | () => document.body |
|
| getSuggestionContainer | 菜单渲染父节点。默认渲染到 body 上,如果你遇到菜单滚动定位问题,试试修改为滚动的区域,并相对其定位 | function() | () => document.body | |
|
||||||
| loading | 加载中 | boolean | false |
|
| loading | 加载中 | boolean | false | |
|
||||||
| multiLines | 多行模式 | boolean | false |
|
| multiLines | 多行模式 | boolean | false | |
|
||||||
| notFoundContent | 未找到时的内容 | string | '无匹配结果,轻敲空格完成输入' |
|
| notFoundContent | 未找到时的内容 | string | '无匹配结果,轻敲空格完成输入' | |
|
||||||
| placeholder | 输入框默认文字 | string | null |
|
| placeholder | 输入框默认文字 | string | null | |
|
||||||
| placement | 建议框位置,可选 `top` `bottom` | string | 'bottom' |
|
| placement | 建议框位置,可选 `top` `bottom` | string | 'bottom' | |
|
||||||
| prefix | 触发弹出下拉框的字符 | string or Array<string> | '@' |
|
| prefix | 触发弹出下拉框的字符 | string or Array<string> | '@' | |
|
||||||
| readOnly | 是否只读. | boolean | false |
|
| readOnly | 是否只读. | boolean | false | |
|
||||||
| suggestions | 建议内容 | Array<string\|Mention.Nav> | \[] |
|
| suggestions | 建议内容 | Array<string\|Mention.Nav> | \[] | |
|
||||||
| suggestionStyle | 弹出下拉框样式 | object | {} |
|
| suggestionStyle | 弹出下拉框样式 | object | {} | |
|
||||||
| value | 值 | ContentState | null |
|
| value | 值 | ContentState | null | |
|
||||||
| onBlur | 失去焦点时回调 | function(e) | null |
|
| onBlur | 失去焦点时回调 | function(e) | null | |
|
||||||
| onChange | 输入框内容变化时回调 | function(contentState: ContentState) | null |
|
| onChange | 输入框内容变化时回调 | function(contentState: ContentState) | null | |
|
||||||
| onFocus | 获得焦点时回调 | function(e) | null |
|
| onFocus | 获得焦点时回调 | function(e) | null | |
|
||||||
| onSearchChange | 输入框中 @ 变化时回调 | function(value:string, trigger: string) | \[] |
|
| onSearchChange | 输入框中 @ 变化时回调 | function(value:string, trigger: string) | \[] | |
|
||||||
| onSelect | 下拉框选择建议时回调 | function(suggestion: string, data?: any) | null |
|
| onSelect | 下拉框选择建议时回调 | function(suggestion: string, data?: any) | null | |
|
||||||
|
|
||||||
### Mention 方法
|
### Mention 方法
|
||||||
|
|
||||||
| 名称 | 描述 |
|
| 名称 | 描述 | 版本 |
|
||||||
| ------- | -------- |
|
| ------- | -------- | ---- |
|
||||||
| blur() | 移除焦点 |
|
| blur() | 移除焦点 | |
|
||||||
| focus() | 获取焦点 |
|
| focus() | 获取焦点 | |
|
||||||
|
|
||||||
### Nav
|
### Nav
|
||||||
|
|
||||||
| 参数 | 说明 | 类型 | 默认值 |
|
| 参数 | 说明 | 类型 | 默认值 | 版本 |
|
||||||
| -------- | ---------------------------------------- | ------ | ------ |
|
| -------- | ---------------------------------------- | ------ | ------ | ---- |
|
||||||
| children | 建议内容 | object | {} |
|
| children | 建议内容 | object | {} | |
|
||||||
| value | 建议值,选择建议时,用此值插入到输入框中 | string | "" |
|
| value | 建议值,选择建议时,用此值插入到输入框中 | string | "" | |
|
||||||
|
@ -22,33 +22,33 @@ When need to mention someone or something.
|
|||||||
|
|
||||||
### Mention
|
### Mention
|
||||||
|
|
||||||
| Property | Description | Type | Default |
|
| Property | Description | Type | Default | Version |
|
||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- | --- |
|
||||||
| autoFocus | Auto get focus when component mounted | boolean | `false` |
|
| autoFocus | Auto get focus when component mounted | boolean | `false` | 3.19.0 |
|
||||||
| defaultValue | Default value | string | - |
|
| defaultValue | Default value | string | - | 3.19.0 |
|
||||||
| filterOption | Customize filter option logic | false \| (input: string, option: OptionProps) => boolean | - |
|
| filterOption | Customize filter option logic | false \| (input: string, option: OptionProps) => boolean | - | 3.19.0 |
|
||||||
| notFoundContent | Set mentions content when not match | ReactNode | 'Not Found' |
|
| notFoundContent | Set mentions content when not match | ReactNode | 'Not Found' | 3.19.0 |
|
||||||
| placement | Set popup placement | 'top' \| 'bottom' | 'bottom' |
|
| placement | Set popup placement | 'top' \| 'bottom' | 'bottom' | 3.19.0 |
|
||||||
| prefix | Set trigger prefix keyword | string \| string[] | '@' |
|
| prefix | Set trigger prefix keyword | string \| string[] | '@' | 3.19.0 |
|
||||||
| split | Set split string before and after selected mention | string | ' ' |
|
| split | Set split string before and after selected mention | string | ' ' | 3.19.0 |
|
||||||
| validateSearch | Customize trigger search logic | (text: string, props: MentionsProps) => void | - |
|
| validateSearch | Customize trigger search logic | (text: string, props: MentionsProps) => void | - | 3.19.0 |
|
||||||
| value | Set value of mentions | string | - |
|
| value | Set value of mentions | string | - | 3.19.0 |
|
||||||
| onChange | Trigger when value changed | (text: string) => void | - |
|
| onChange | Trigger when value changed | (text: string) => void | - | 3.19.0 |
|
||||||
| onSelect | Trigger when user select the option | (option: OptionProps, prefix: string) => void | - |
|
| onSelect | Trigger when user select the option | (option: OptionProps, prefix: string) => void | - | 3.19.0 |
|
||||||
| onSearch | Trigger when prefix hit | (text: string, prefix: string) => void | - |
|
| onSearch | Trigger when prefix hit | (text: string, prefix: string) => void | - | 3.19.0 |
|
||||||
| onFocus | Trigger when mentions get focus | () => void | - |
|
| onFocus | Trigger when mentions get focus | () => void | - | 3.19.0 |
|
||||||
| onBlur | Trigger when mentions lose focus | () => void | - |
|
| onBlur | Trigger when mentions lose focus | () => void | - | 3.19.0 |
|
||||||
|
|
||||||
### Mention methods
|
### Mention methods
|
||||||
|
|
||||||
| Name | Description |
|
| Name | Description | Version |
|
||||||
| ------- | ------------ |
|
| ------- | ------------ | ------- |
|
||||||
| blur() | remove focus |
|
| blur() | remove focus | 3.19.0 |
|
||||||
| focus() | get focus |
|
| focus() | get focus | 3.19.0 |
|
||||||
|
|
||||||
### Option
|
### Option
|
||||||
|
|
||||||
| Property | Description | Type | Default |
|
| Property | Description | Type | Default | Version |
|
||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- | --- |
|
||||||
| children | suggestion content | ReactNode | - |
|
| children | suggestion content | ReactNode | - | 3.19.0 |
|
||||||
| value | value of suggestion, the value will insert into input filed while selected | string | '' |
|
| value | value of suggestion, the value will insert into input filed while selected | string | '' | 3.19.0 |
|
||||||
|
@ -32,33 +32,33 @@ title: Mentions
|
|||||||
|
|
||||||
### Mention
|
### Mention
|
||||||
|
|
||||||
| 参数 | 说明 | 类型 | 默认值 |
|
| 参数 | 说明 | 类型 | 默认值 | 版本 |
|
||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- | --- |
|
||||||
| autoFocus | 自动获得焦点 | boolean | `false` |
|
| autoFocus | 自动获得焦点 | boolean | `false` | 3.19.0 |
|
||||||
| defaultValue | 默认值 | string | - |
|
| defaultValue | 默认值 | string | - | 3.19.0 |
|
||||||
| filterOption | 自定义过滤逻辑 | false \| (input: string, option: OptionProps) => boolean | - |
|
| filterOption | 自定义过滤逻辑 | false \| (input: string, option: OptionProps) => boolean | - | 3.19.0 |
|
||||||
| notFoundContent | 当下拉列表为空时显示的内容 | ReactNode | 'Not Found' |
|
| notFoundContent | 当下拉列表为空时显示的内容 | ReactNode | 'Not Found' | 3.19.0 |
|
||||||
| placement | 弹出层展示位置 | 'top' \| 'bottom' | 'bottom' |
|
| placement | 弹出层展示位置 | 'top' \| 'bottom' | 'bottom' | 3.19.0 |
|
||||||
| prefix | 设置触发关键字 | string \| string[] | '@' |
|
| prefix | 设置触发关键字 | string \| string[] | '@' | 3.19.0 |
|
||||||
| split | 设置选中项前后分隔符 | string | ' ' |
|
| split | 设置选中项前后分隔符 | string | ' ' | 3.19.0 |
|
||||||
| validateSearch | 自定义触发验证逻辑 | (text: string, props: MentionsProps) => void | - |
|
| validateSearch | 自定义触发验证逻辑 | (text: string, props: MentionsProps) => void | - | 3.19.0 |
|
||||||
| value | 设置值 | string | - |
|
| value | 设置值 | string | - | 3.19.0 |
|
||||||
| onChange | 值改变时触发 | (text: string) => void | - |
|
| onChange | 值改变时触发 | (text: string) => void | - | 3.19.0 |
|
||||||
| onSelect | 选择选项时触发 | (option: OptionProps, prefix: string) => void | - |
|
| onSelect | 选择选项时触发 | (option: OptionProps, prefix: string) => void | - | 3.19.0 |
|
||||||
| onSearch | 搜索时触发 | (text: string, prefix: string) => void | - |
|
| onSearch | 搜索时触发 | (text: string, prefix: string) => void | - | 3.19.0 |
|
||||||
| onFocus | 获得焦点时触发 | () => void | - |
|
| onFocus | 获得焦点时触发 | () => void | - | 3.19.0 |
|
||||||
| onBlur | 失去焦点时触发 | () => void | - |
|
| onBlur | 失去焦点时触发 | () => void | - | 3.19.0 |
|
||||||
|
|
||||||
### Mention 方法
|
### Mention 方法
|
||||||
|
|
||||||
| 名称 | 描述 |
|
| 名称 | 描述 | 版本 |
|
||||||
| ------- | -------- |
|
| ------- | -------- | ------ |
|
||||||
| blur() | 移除焦点 |
|
| blur() | 移除焦点 | 3.19.0 |
|
||||||
| focus() | 获取焦点 |
|
| focus() | 获取焦点 | 3.19.0 |
|
||||||
|
|
||||||
### Option
|
### Option
|
||||||
|
|
||||||
| 参数 | 说明 | 类型 | 默认值 |
|
| 参数 | 说明 | 类型 | 默认值 | 版本 |
|
||||||
| -------- | -------------- | --------- | ------ |
|
| -------- | -------------- | --------- | ------ | ------ |
|
||||||
| children | 选项内容 | ReactNode | - |
|
| children | 选项内容 | ReactNode | - | 3.19.0 |
|
||||||
| value | 选择时填充的值 | string | '' |
|
| value | 选择时填充的值 | string | '' | 3.19.0 |
|
||||||
|
@ -26,54 +26,54 @@ More layouts with navigation: [layout](/components/layout).
|
|||||||
|
|
||||||
### Menu
|
### Menu
|
||||||
|
|
||||||
| Param | Description | Type | Default value |
|
| Param | Description | Type | Default value | Version |
|
||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- | --- |
|
||||||
| defaultOpenKeys | array with the keys of default opened sub menus | string\[] | |
|
| defaultOpenKeys | array with the keys of default opened sub menus | string\[] | | |
|
||||||
| defaultSelectedKeys | array with the keys of default selected menu items | string\[] | |
|
| defaultSelectedKeys | array with the keys of default selected menu items | string\[] | | |
|
||||||
| forceSubMenuRender | render submenu into DOM before it shows | boolean | false |
|
| forceSubMenuRender | render submenu into DOM before it shows | boolean | false | |
|
||||||
| inlineCollapsed | specifies the collapsed status when menu is inline mode | boolean | - |
|
| inlineCollapsed | specifies the collapsed status when menu is inline mode | boolean | - | |
|
||||||
| inlineIndent | indent px of inline menu item on each level | number | 24 |
|
| inlineIndent | indent px of inline menu item on each level | number | 24 | |
|
||||||
| mode | type of the menu; `vertical`, `horizontal`, and `inline` modes are supported | string: `vertical` \| `horizontal` \| `inline` | `vertical` |
|
| mode | type of the menu; `vertical`, `horizontal`, and `inline` modes are supported | string: `vertical` \| `horizontal` \| `inline` | `vertical` | |
|
||||||
| multiple | Allow selection of multiple items | boolean | false |
|
| multiple | Allow selection of multiple items | boolean | false | |
|
||||||
| openKeys | array with the keys of currently opened sub menus | string\[] | |
|
| openKeys | array with the keys of currently opened sub menus | string\[] | | |
|
||||||
| selectable | allow selecting menu items | boolean | true |
|
| selectable | allow selecting menu items | boolean | true | |
|
||||||
| selectedKeys | array with the keys of currently selected menu items | string\[] | |
|
| selectedKeys | array with the keys of currently selected menu items | string\[] | | |
|
||||||
| style | style of the root node | object | |
|
| style | style of the root node | object | | |
|
||||||
| subMenuCloseDelay | delay time to hide submenu when mouse leave, unit: second | number | 0.1 |
|
| subMenuCloseDelay | delay time to hide submenu when mouse leave, unit: second | number | 0.1 | |
|
||||||
| subMenuOpenDelay | delay time to show submenu when mouse enter, unit: second | number | 0 |
|
| subMenuOpenDelay | delay time to show submenu when mouse enter, unit: second | number | 0 | |
|
||||||
| theme | color theme of the menu | string: `light` `dark` | `light` |
|
| theme | color theme of the menu | string: `light` `dark` | `light` | |
|
||||||
| onClick | callback executed when a menu item is clicked | function({ item, key, keyPath, domEvent }) | - |
|
| onClick | callback executed when a menu item is clicked | function({ item, key, keyPath, domEvent }) | - | |
|
||||||
| onDeselect | callback executed when a menu item is deselected, only supported for multiple mode | function({ item, key, keyPath, selectedKeys, domEvent }) | - |
|
| onDeselect | callback executed when a menu item is deselected, only supported for multiple mode | function({ item, key, keyPath, selectedKeys, domEvent }) | - | |
|
||||||
| onOpenChange | called when open/close sub menu | function(openKeys: string\[]) | noop |
|
| onOpenChange | called when open/close sub menu | function(openKeys: string\[]) | noop | |
|
||||||
| onSelect | callback executed when a menu item is selected | function({ item, key, keyPath, selectedKeys, domEvent }) | none |
|
| onSelect | callback executed when a menu item is selected | function({ item, key, keyPath, selectedKeys, domEvent }) | none | |
|
||||||
| overflowedIndicator | Customized icon when menu collapsed | ReactNode | - |
|
| overflowedIndicator | Customized icon when menu collapsed | ReactNode | - | 3.16.0 |
|
||||||
|
|
||||||
> More options in [rc-menu](https://github.com/react-component/menu#api)
|
> More options in [rc-menu](https://github.com/react-component/menu#api)
|
||||||
|
|
||||||
### Menu.Item
|
### Menu.Item
|
||||||
|
|
||||||
| Param | Description | Type | Default value |
|
| Param | Description | Type | Default value | Version |
|
||||||
| -------- | ------------------------------------ | ------- | ------------- |
|
| -------- | ------------------------------------ | ------- | ------------- | ------- |
|
||||||
| disabled | whether menu item is disabled or not | boolean | false |
|
| disabled | whether menu item is disabled or not | boolean | false | |
|
||||||
| key | unique id of the menu item | string | |
|
| key | unique id of the menu item | string | | |
|
||||||
| title | set display title for collapsed item | string | |
|
| title | set display title for collapsed item | string | | 3.11.0 |
|
||||||
|
|
||||||
### Menu.SubMenu
|
### Menu.SubMenu
|
||||||
|
|
||||||
| Param | Description | Type | Default value |
|
| Param | Description | Type | Default value | Version |
|
||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- | --- |
|
||||||
| children | sub menus or sub menu items | Array<MenuItem\|SubMenu> | |
|
| children | sub menus or sub menu items | Array<MenuItem\|SubMenu> | | |
|
||||||
| disabled | whether sub menu is disabled or not | boolean | false |
|
| disabled | whether sub menu is disabled or not | boolean | false | |
|
||||||
| key | unique id of the sub menu | string | |
|
| key | unique id of the sub menu | string | | |
|
||||||
| title | title of the sub menu | string\|ReactNode | |
|
| title | title of the sub menu | string\|ReactNode | | |
|
||||||
| onTitleClick | callback executed when the sub menu title is clicked | function({ key, domEvent }) | |
|
| onTitleClick | callback executed when the sub menu title is clicked | function({ key, domEvent }) | | |
|
||||||
|
|
||||||
### Menu.ItemGroup
|
### Menu.ItemGroup
|
||||||
|
|
||||||
| Param | Description | Type | Default value |
|
| Param | Description | Type | Default value | Version |
|
||||||
| -------- | ------------------ | ----------------- | ------------- |
|
| -------- | ------------------ | ----------------- | ------------- | ------- |
|
||||||
| children | sub menu items | MenuItem\[] | |
|
| children | sub menu items | MenuItem\[] | | |
|
||||||
| title | title of the group | string\|ReactNode | |
|
| title | title of the group | string\|ReactNode | | |
|
||||||
|
|
||||||
### Menu.Divider
|
### Menu.Divider
|
||||||
|
|
||||||
|
@ -27,54 +27,54 @@ subtitle: 导航菜单
|
|||||||
|
|
||||||
### Menu
|
### Menu
|
||||||
|
|
||||||
| 参数 | 说明 | 类型 | 默认值 |
|
| 参数 | 说明 | 类型 | 默认值 | 版本 |
|
||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- | --- |
|
||||||
| defaultOpenKeys | 初始展开的 SubMenu 菜单项 key 数组 | string\[] | |
|
| defaultOpenKeys | 初始展开的 SubMenu 菜单项 key 数组 | string\[] | | |
|
||||||
| defaultSelectedKeys | 初始选中的菜单项 key 数组 | string\[] | |
|
| defaultSelectedKeys | 初始选中的菜单项 key 数组 | string\[] | | |
|
||||||
| forceSubMenuRender | 在子菜单展示之前就渲染进 DOM | boolean | false |
|
| forceSubMenuRender | 在子菜单展示之前就渲染进 DOM | boolean | false | |
|
||||||
| inlineCollapsed | inline 时菜单是否收起状态 | boolean | - |
|
| inlineCollapsed | inline 时菜单是否收起状态 | boolean | - | |
|
||||||
| inlineIndent | inline 模式的菜单缩进宽度 | number | 24 |
|
| inlineIndent | inline 模式的菜单缩进宽度 | number | 24 | |
|
||||||
| mode | 菜单类型,现在支持垂直、水平、和内嵌模式三种 | string: `vertical` `horizontal` `inline` | `vertical` |
|
| mode | 菜单类型,现在支持垂直、水平、和内嵌模式三种 | string: `vertical` `horizontal` `inline` | `vertical` | |
|
||||||
| multiple | 是否允许多选 | boolean | false |
|
| multiple | 是否允许多选 | boolean | false | |
|
||||||
| openKeys | 当前展开的 SubMenu 菜单项 key 数组 | string\[] | |
|
| openKeys | 当前展开的 SubMenu 菜单项 key 数组 | string\[] | | |
|
||||||
| selectable | 是否允许选中 | boolean | true |
|
| selectable | 是否允许选中 | boolean | true | |
|
||||||
| selectedKeys | 当前选中的菜单项 key 数组 | string\[] | |
|
| selectedKeys | 当前选中的菜单项 key 数组 | string\[] | | |
|
||||||
| style | 根节点样式 | object | |
|
| style | 根节点样式 | object | | |
|
||||||
| subMenuCloseDelay | 用户鼠标离开子菜单后关闭延时,单位:秒 | number | 0.1 |
|
| subMenuCloseDelay | 用户鼠标离开子菜单后关闭延时,单位:秒 | number | 0.1 | |
|
||||||
| subMenuOpenDelay | 用户鼠标进入子菜单后开启延时,单位:秒 | number | 0 |
|
| subMenuOpenDelay | 用户鼠标进入子菜单后开启延时,单位:秒 | number | 0 | |
|
||||||
| theme | 主题颜色 | string: `light` `dark` | `light` |
|
| theme | 主题颜色 | string: `light` `dark` | `light` | |
|
||||||
| onClick | 点击 MenuItem 调用此函数 | function({ item, key, keyPath, domEvent }) | - |
|
| onClick | 点击 MenuItem 调用此函数 | function({ item, key, keyPath, domEvent }) | - | |
|
||||||
| onDeselect | 取消选中时调用,仅在 multiple 生效 | function({ item, key, keyPath, selectedKeys, domEvent }) | - |
|
| onDeselect | 取消选中时调用,仅在 multiple 生效 | function({ item, key, keyPath, selectedKeys, domEvent }) | - | |
|
||||||
| onOpenChange | SubMenu 展开/关闭的回调 | function(openKeys: string\[]) | noop |
|
| onOpenChange | SubMenu 展开/关闭的回调 | function(openKeys: string\[]) | noop | |
|
||||||
| onSelect | 被选中时调用 | function({ item, key, keyPath, selectedKeys, domEvent }) | 无 |
|
| onSelect | 被选中时调用 | function({ item, key, keyPath, selectedKeys, domEvent }) | 无 | |
|
||||||
| overflowedIndicator | 自定义 Menu 折叠时的图标 | ReactNode | - |
|
| overflowedIndicator | 自定义 Menu 折叠时的图标 | ReactNode | - | 3.16.0 |
|
||||||
|
|
||||||
> More options in [rc-menu](https://github.com/react-component/menu#api)
|
> More options in [rc-menu](https://github.com/react-component/menu#api)
|
||||||
|
|
||||||
### Menu.Item
|
### Menu.Item
|
||||||
|
|
||||||
| 参数 | 说明 | 类型 | 默认值 |
|
| 参数 | 说明 | 类型 | 默认值 | 版本 |
|
||||||
| -------- | ------------------------ | ------- | ------ |
|
| -------- | ------------------------ | ------- | ------ | ------ |
|
||||||
| disabled | 是否禁用 | boolean | false |
|
| disabled | 是否禁用 | boolean | false | |
|
||||||
| key | item 的唯一标志 | string | |
|
| key | item 的唯一标志 | string | | |
|
||||||
| title | 设置收缩时展示的悬浮标题 | string | |
|
| title | 设置收缩时展示的悬浮标题 | string | | 3.11.0 |
|
||||||
|
|
||||||
### Menu.SubMenu
|
### Menu.SubMenu
|
||||||
|
|
||||||
| 参数 | 说明 | 类型 | 默认值 |
|
| 参数 | 说明 | 类型 | 默认值 | 版本 |
|
||||||
| ------------ | -------------- | --------------------------- | ------ |
|
| ------------ | -------------- | --------------------------- | ------ | ---- |
|
||||||
| children | 子菜单的菜单项 | Array<MenuItem\|SubMenu> | |
|
| children | 子菜单的菜单项 | Array<MenuItem\|SubMenu> | | |
|
||||||
| disabled | 是否禁用 | boolean | false |
|
| disabled | 是否禁用 | boolean | false | |
|
||||||
| key | 唯一标志 | string | |
|
| key | 唯一标志 | string | | |
|
||||||
| title | 子菜单项值 | string\|ReactNode | |
|
| title | 子菜单项值 | string\|ReactNode | | |
|
||||||
| onTitleClick | 点击子菜单标题 | function({ key, domEvent }) | |
|
| onTitleClick | 点击子菜单标题 | function({ key, domEvent }) | | |
|
||||||
|
|
||||||
### Menu.ItemGroup
|
### Menu.ItemGroup
|
||||||
|
|
||||||
| 参数 | 说明 | 类型 | 默认值 |
|
| 参数 | 说明 | 类型 | 默认值 | 版本 |
|
||||||
| -------- | ------------ | ----------------- | ------ |
|
| -------- | ------------ | ----------------- | ------ | ---- |
|
||||||
| children | 分组的菜单项 | MenuItem\[] | |
|
| children | 分组的菜单项 | MenuItem\[] | | |
|
||||||
| title | 分组标题 | string\|ReactNode | |
|
| title | 分组标题 | string\|ReactNode | | |
|
||||||
|
|
||||||
### Menu.Divider
|
### Menu.Divider
|
||||||
|
|
||||||
|
@ -23,11 +23,11 @@ This components provides some static methods, with usage and arguments as follow
|
|||||||
- `message.warn(content, [duration], onClose)` // alias of warning
|
- `message.warn(content, [duration], onClose)` // alias of warning
|
||||||
- `message.loading(content, [duration], onClose)`
|
- `message.loading(content, [duration], onClose)`
|
||||||
|
|
||||||
| Argument | Description | Type | Default |
|
| Argument | Description | Type | Default | Version |
|
||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- | --- |
|
||||||
| content | content of the message | string\|ReactNode | - |
|
| content | content of the message | string\|ReactNode | - | |
|
||||||
| duration | time(seconds) before auto-dismiss, don't dismiss if set to 0 | number | 1.5 |
|
| duration | time(seconds) before auto-dismiss, don't dismiss if set to 0 | number | 1.5 | |
|
||||||
| onClose | Specify a function that will be called when the message is closed | Function | - |
|
| onClose | Specify a function that will be called when the message is closed | Function | - | |
|
||||||
|
|
||||||
`afterClose` can be called in thenable interface:
|
`afterClose` can be called in thenable interface:
|
||||||
|
|
||||||
@ -40,12 +40,12 @@ where `level` refers one static methods of `message`. The result of `then` metho
|
|||||||
|
|
||||||
The properties of config are as follows:
|
The properties of config are as follows:
|
||||||
|
|
||||||
| Property | Description | Type | Default |
|
| Property | Description | Type | Default | Version |
|
||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- | --- |
|
||||||
| content | content of the message | ReactNode | - |
|
| content | content of the message | ReactNode | - | |
|
||||||
| duration | time(seconds) before auto-dismiss, don't dismiss if set to 0 | number | 3 |
|
| duration | time(seconds) before auto-dismiss, don't dismiss if set to 0 | number | 3 | |
|
||||||
| onClose | Specify a function that will be called when the message is closed | function | - |
|
| onClose | Specify a function that will be called when the message is closed | function | - | |
|
||||||
| icon | Customized Icon | ReactNode | - |
|
| icon | Customized Icon | ReactNode | - | 3.9.0 |
|
||||||
|
|
||||||
### Global static methods
|
### Global static methods
|
||||||
|
|
||||||
@ -64,9 +64,9 @@ message.config({
|
|||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
| Argument | Description | Type | Default |
|
| Argument | Description | Type | Default | Version |
|
||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- | --- |
|
||||||
| duration | time before auto-dismiss, in seconds | number | 1.5 |
|
| duration | time before auto-dismiss, in seconds | number | 1.5 | 3.9.0 |
|
||||||
| getContainer | Return the mount node for Message | () => HTMLElement | () => document.body |
|
| getContainer | Return the mount node for Message | () => HTMLElement | () => document.body | 3.9.0 |
|
||||||
| maxCount | max message show, drop oldest if exceed limit | number | - |
|
| maxCount | max message show, drop oldest if exceed limit | number | - | 3.9.0 |
|
||||||
| top | distance from top | number | 24 |
|
| top | distance from top | number | 24 | 3.9.0 |
|
||||||
|
@ -24,11 +24,11 @@ title: Message
|
|||||||
- `message.warn(content, [duration], onClose)` // alias of warning
|
- `message.warn(content, [duration], onClose)` // alias of warning
|
||||||
- `message.loading(content, [duration], onClose)`
|
- `message.loading(content, [duration], onClose)`
|
||||||
|
|
||||||
| 参数 | 说明 | 类型 | 默认值 |
|
| 参数 | 说明 | 类型 | 默认值 | 版本 |
|
||||||
| -------- | --------------------------------------------- | ----------------- | ------ |
|
| -------- | --------------------------------------------- | ----------------- | ------ | ---- |
|
||||||
| content | 提示内容 | string\|ReactNode | - |
|
| content | 提示内容 | string\|ReactNode | - | |
|
||||||
| duration | 自动关闭的延时,单位秒。设为 0 时不自动关闭。 | number | 3 |
|
| duration | 自动关闭的延时,单位秒。设为 0 时不自动关闭。 | number | 3 | |
|
||||||
| onClose | 关闭时触发的回调函数 | Function | - |
|
| onClose | 关闭时触发的回调函数 | Function | - | |
|
||||||
|
|
||||||
组件同时提供 promise 接口。
|
组件同时提供 promise 接口。
|
||||||
|
|
||||||
@ -39,12 +39,12 @@ title: Message
|
|||||||
|
|
||||||
- `message.open(config)`
|
- `message.open(config)`
|
||||||
|
|
||||||
| 参数 | 说明 | 类型 | 默认值 |
|
| 参数 | 说明 | 类型 | 默认值 | 版本 |
|
||||||
| -------- | --------------------------------------------- | --------- | ------ |
|
| -------- | --------------------------------------------- | --------- | ------ | ----- |
|
||||||
| content | 提示内容 | ReactNode | - |
|
| content | 提示内容 | ReactNode | - | |
|
||||||
| duration | 自动关闭的延时,单位秒。设为 0 时不自动关闭。 | number | 3 |
|
| duration | 自动关闭的延时,单位秒。设为 0 时不自动关闭。 | number | 3 | |
|
||||||
| onClose | 关闭时触发的回调函数 | Function | - |
|
| onClose | 关闭时触发的回调函数 | Function | - | |
|
||||||
| icon | 自定义图标 | ReactNode | - |
|
| icon | 自定义图标 | ReactNode | - | 3.9.0 |
|
||||||
|
|
||||||
### 全局方法
|
### 全局方法
|
||||||
|
|
||||||
@ -63,9 +63,9 @@ message.config({
|
|||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
| 参数 | 说明 | 类型 | 默认值 |
|
| 参数 | 说明 | 类型 | 默认值 | 版本 |
|
||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- | --- |
|
||||||
| duration | 默认自动关闭延时,单位秒 | number | 3 |
|
| duration | 默认自动关闭延时,单位秒 | number | 3 | 3.9.0 |
|
||||||
| getContainer | 配置渲染节点的输出位置 | () => HTMLElement | () => document.body |
|
| getContainer | 配置渲染节点的输出位置 | () => HTMLElement | () => document.body | 3.9.0 |
|
||||||
| maxCount | 最大显示数, 超过限制时,最早的消息会被自动关闭 | number | - |
|
| maxCount | 最大显示数, 超过限制时,最早的消息会被自动关闭 | number | - | 3.9.0 |
|
||||||
| top | 消息距离顶部的位置 | number | 24 |
|
| top | 消息距离顶部的位置 | number | 24 | 3.9.0 |
|
||||||
|
@ -12,33 +12,33 @@ When requiring users to interact with the application, but without jumping to a
|
|||||||
|
|
||||||
## API
|
## API
|
||||||
|
|
||||||
| Property | Description | Type | Default |
|
| Property | Description | Type | Default | Version |
|
||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- | --- |
|
||||||
| afterClose | Specify a function that will be called when modal is closed completely. | function | - |
|
| afterClose | Specify a function that will be called when modal is closed completely. | function | - | |
|
||||||
| bodyStyle | Body style for modal body element. Such as height, padding etc. | object | {} |
|
| bodyStyle | Body style for modal body element. Such as height, padding etc. | object | {} | |
|
||||||
| cancelText | Text of the Cancel button | string\|ReactNode | `Cancel` |
|
| cancelText | Text of the Cancel button | string\|ReactNode | `Cancel` | |
|
||||||
| centered | Centered Modal | Boolean | `false` |
|
| centered | Centered Modal | Boolean | `false` | 3.8.0 |
|
||||||
| closable | Whether a close (x) button is visible on top right of the modal dialog or not | boolean | true |
|
| closable | Whether a close (x) button is visible on top right of the modal dialog or not | boolean | true | |
|
||||||
| confirmLoading | Whether to apply loading visual effect for OK button or not | boolean | false |
|
| confirmLoading | Whether to apply loading visual effect for OK button or not | boolean | false | |
|
||||||
| destroyOnClose | Whether to unmount child components on onClose | boolean | false |
|
| destroyOnClose | Whether to unmount child components on onClose | boolean | false | 3.1.0 |
|
||||||
| footer | Footer content, set as `footer={null}` when you don't need default buttons | string\|ReactNode | OK and Cancel buttons |
|
| footer | Footer content, set as `footer={null}` when you don't need default buttons | string\|ReactNode | OK and Cancel buttons | |
|
||||||
| forceRender | Force render Modal | boolean | false |
|
| forceRender | Force render Modal | boolean | false | 3.12.0 |
|
||||||
| getContainer | Return the mount node for Modal | (instance): HTMLElement | () => document.body |
|
| getContainer | Return the mount node for Modal | (instance): HTMLElement | () => document.body | |
|
||||||
| mask | Whether show mask or not. | Boolean | true |
|
| mask | Whether show mask or not. | Boolean | true | |
|
||||||
| maskClosable | Whether to close the modal dialog when the mask (area outside the modal) is clicked | boolean | true |
|
| maskClosable | Whether to close the modal dialog when the mask (area outside the modal) is clicked | boolean | true | |
|
||||||
| maskStyle | Style for modal's mask element. | object | {} |
|
| maskStyle | Style for modal's mask element. | object | {} | |
|
||||||
| okText | Text of the OK button | string\|ReactNode | `OK` |
|
| okText | Text of the OK button | string\|ReactNode | `OK` | |
|
||||||
| okType | Button `type` of the OK button | string | `primary` |
|
| okType | Button `type` of the OK button | string | `primary` | |
|
||||||
| okButtonProps | The ok button props | [ButtonProps](/components/button) | - |
|
| okButtonProps | The ok button props | [ButtonProps](/components/button) | - | 3.7.0 |
|
||||||
| cancelButtonProps | The cancel button props | [ButtonProps](/components/button) | - |
|
| cancelButtonProps | The cancel button props | [ButtonProps](/components/button) | - | 3.7.0 |
|
||||||
| style | Style of floating layer, typically used at least for adjusting the position. | object | - |
|
| style | Style of floating layer, typically used at least for adjusting the position. | object | - | |
|
||||||
| title | The modal dialog's title | string\|ReactNode | - |
|
| title | The modal dialog's title | string\|ReactNode | - | |
|
||||||
| visible | Whether the modal dialog is visible or not | boolean | false |
|
| visible | Whether the modal dialog is visible or not | boolean | false | |
|
||||||
| width | Width of the modal dialog | string\|number | 520 |
|
| width | Width of the modal dialog | string\|number | 520 | |
|
||||||
| wrapClassName | The class name of the container of the modal dialog | string | - |
|
| wrapClassName | The class name of the container of the modal dialog | string | - | |
|
||||||
| zIndex | The `z-index` of the Modal | Number | 1000 |
|
| zIndex | The `z-index` of the Modal | Number | 1000 | |
|
||||||
| onCancel | Specify a function that will be called when a user clicks mask, close button on top right or Cancel button | function(e) | - |
|
| onCancel | Specify a function that will be called when a user clicks mask, close button on top right or Cancel button | function(e) | - | |
|
||||||
| onOk | Specify a function that will be called when a user clicks the OK button | function(e) | - |
|
| onOk | Specify a function that will be called when a user clicks the OK button | function(e) | - | |
|
||||||
|
|
||||||
#### Note
|
#### Note
|
||||||
|
|
||||||
@ -56,27 +56,27 @@ There are five ways to display the information based on the content's nature:
|
|||||||
|
|
||||||
The items listed above are all functions, expecting a settings object as parameter. The properties of the object are follows:
|
The items listed above are all functions, expecting a settings object as parameter. The properties of the object are follows:
|
||||||
|
|
||||||
| Property | Description | Type | Default |
|
| Property | Description | Type | Default | Version |
|
||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- | --- |
|
||||||
| autoFocusButton | Specify which button to autofocus | null\|string: `ok` `cancel` | `ok` |
|
| autoFocusButton | Specify which button to autofocus | null\|string: `ok` `cancel` | `ok` | 3.10.0 |
|
||||||
| cancelText | Text of the Cancel button with Modal.confirm | string | `Cancel` |
|
| cancelText | Text of the Cancel button with Modal.confirm | string | `Cancel` | |
|
||||||
| centered | Centered Modal | Boolean | `false` |
|
| centered | Centered Modal | Boolean | `false` | 3.8.0 |
|
||||||
| className | className of container | string | - |
|
| className | className of container | string | - | 3.1.1 |
|
||||||
| content | Content | string\|ReactNode | - |
|
| content | Content | string\|ReactNode | - | |
|
||||||
| icon | custom icon (`Added in 3.12.0`) | string\|ReactNode | `<Icon type="question-circle">` |
|
| icon | custom icon (`Added in 3.12.0`) | string\|ReactNode | `<Icon type="question-circle">` | 3.12.0 |
|
||||||
| iconType | Icon `type` of the Icon component (deperated after `3.12.0`) | string | `question-circle` |
|
| iconType | Icon `type` of the Icon component (deperated after `3.12.0`) | string | `question-circle` | |
|
||||||
| keyboard | Whether support press esc to close | Boolean | true |
|
| keyboard | Whether support press esc to close | Boolean | true | 3.4.2 |
|
||||||
| mask | Whether show mask or not. | Boolean | true |
|
| mask | Whether show mask or not. | Boolean | true | 3.13.0 |
|
||||||
| maskClosable | Whether to close the modal dialog when the mask (area outside the modal) is clicked | Boolean | `false` |
|
| maskClosable | Whether to close the modal dialog when the mask (area outside the modal) is clicked | Boolean | `false` | |
|
||||||
| okText | Text of the OK button | string | `OK` |
|
| okText | Text of the OK button | string | `OK` | |
|
||||||
| okType | Button `type` of the OK button | string | `primary` |
|
| okType | Button `type` of the OK button | string | `primary` | |
|
||||||
| okButtonProps | The ok button props | [ButtonProps](/components/button) | - |
|
| okButtonProps | The ok button props | [ButtonProps](/components/button) | - | 3.10.0 |
|
||||||
| cancelButtonProps | The cancel button props | [ButtonProps](/components/button) | - |
|
| cancelButtonProps | The cancel button props | [ButtonProps](/components/button) | - | 3.10.0 |
|
||||||
| title | Title | string\|ReactNode | - |
|
| title | Title | string\|ReactNode | - | |
|
||||||
| width | Width of the modal dialog | string\|number | 416 |
|
| width | Width of the modal dialog | string\|number | 416 | |
|
||||||
| zIndex | The `z-index` of the Modal | Number | 1000 |
|
| zIndex | The `z-index` of the Modal | Number | 1000 | |
|
||||||
| onCancel | Specify a function that will be called when the user clicks the Cancel button. The parameter of this function is a function whose execution should include closing the dialog. You can also just return a promise and when the promise is resolved, the modal dialog will also be closed | function | - |
|
| onCancel | Specify a function that will be called when the user clicks the Cancel button. The parameter of this function is a function whose execution should include closing the dialog. You can also just return a promise and when the promise is resolved, the modal dialog will also be closed | function | - | |
|
||||||
| onOk | Specify a function that will be called when the user clicks the OK button. The parameter of this function is a function whose execution should include closing the dialog. You can also just return a promise and when the promise is resolved, the modal dialog will also be closed | function | - |
|
| onOk | Specify a function that will be called when the user clicks the OK button. The parameter of this function is a function whose execution should include closing the dialog. You can also just return a promise and when the promise is resolved, the modal dialog will also be closed | function | - | |
|
||||||
|
|
||||||
All the `Modal.method`s will return a reference, and then we can update and close the modal dialog by the reference.
|
All the `Modal.method`s will return a reference, and then we can update and close the modal dialog by the reference.
|
||||||
|
|
||||||
|
@ -15,34 +15,34 @@ title: Modal
|
|||||||
|
|
||||||
## API
|
## API
|
||||||
|
|
||||||
| 参数 | 说明 | 类型 | 默认值 |
|
| 参数 | 说明 | 类型 | 默认值 | 版本 |
|
||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- | --- |
|
||||||
| afterClose | Modal 完全关闭后的回调 | function | 无 |
|
| afterClose | Modal 完全关闭后的回调 | function | 无 | |
|
||||||
| bodyStyle | Modal body 样式 | object | {} |
|
| bodyStyle | Modal body 样式 | object | {} | |
|
||||||
| cancelText | 取消按钮文字 | string\|ReactNode | 取消 |
|
| cancelText | 取消按钮文字 | string\|ReactNode | 取消 | |
|
||||||
| centered | 垂直居中展示 Modal | Boolean | `false` |
|
| centered | 垂直居中展示 Modal | Boolean | `false` | 3.8.0 |
|
||||||
| closable | 是否显示右上角的关闭按钮 | boolean | true |
|
| closable | 是否显示右上角的关闭按钮 | boolean | true | |
|
||||||
| confirmLoading | 确定按钮 loading | boolean | 无 |
|
| confirmLoading | 确定按钮 loading | boolean | 无 | |
|
||||||
| destroyOnClose | 关闭时销毁 Modal 里的子元素 | boolean | false |
|
| destroyOnClose | 关闭时销毁 Modal 里的子元素 | boolean | false | 3.1.0 |
|
||||||
| footer | 底部内容,当不需要默认底部按钮时,可以设为 `footer={null}` | string\|ReactNode | 确定取消按钮 |
|
| footer | 底部内容,当不需要默认底部按钮时,可以设为 `footer={null}` | string\|ReactNode | 确定取消按钮 | |
|
||||||
| forceRender | 强制渲染 Modal | boolean | false |
|
| forceRender | 强制渲染 Modal | boolean | false | 3.12.0 |
|
||||||
| getContainer | 指定 Modal 挂载的 HTML 节点 | (instance): HTMLElement | () => document.body |
|
| getContainer | 指定 Modal 挂载的 HTML 节点 | (instance): HTMLElement | () => document.body | |
|
||||||
| keyboard | 是否支持键盘 esc 关闭 | boolean | true |
|
| keyboard | 是否支持键盘 esc 关闭 | boolean | true | 3.4.2 |
|
||||||
| mask | 是否展示遮罩 | Boolean | true |
|
| mask | 是否展示遮罩 | Boolean | true | |
|
||||||
| maskClosable | 点击蒙层是否允许关闭 | boolean | true |
|
| maskClosable | 点击蒙层是否允许关闭 | boolean | true | |
|
||||||
| maskStyle | 遮罩样式 | object | {} |
|
| maskStyle | 遮罩样式 | object | {} | |
|
||||||
| okText | 确认按钮文字 | string\|ReactNode | 确定 |
|
| okText | 确认按钮文字 | string\|ReactNode | 确定 | |
|
||||||
| okType | 确认按钮类型 | string | primary |
|
| okType | 确认按钮类型 | string | primary | |
|
||||||
| okButtonProps | ok 按钮 props | [ButtonProps](/components/button) | - |
|
| okButtonProps | ok 按钮 props | [ButtonProps](/components/button) | - | 3.7.0 |
|
||||||
| cancelButtonProps | cancel 按钮 props | [ButtonProps](/components/button) | - |
|
| cancelButtonProps | cancel 按钮 props | [ButtonProps](/components/button) | - | 3.7.0 |
|
||||||
| style | 可用于设置浮层的样式,调整浮层位置等 | object | - |
|
| style | 可用于设置浮层的样式,调整浮层位置等 | object | - | |
|
||||||
| title | 标题 | string\|ReactNode | 无 |
|
| title | 标题 | string\|ReactNode | 无 | |
|
||||||
| visible | 对话框是否可见 | boolean | 无 |
|
| visible | 对话框是否可见 | boolean | 无 | |
|
||||||
| width | 宽度 | string\|number | 520 |
|
| width | 宽度 | string\|number | 520 | |
|
||||||
| wrapClassName | 对话框外层容器的类名 | string | - |
|
| wrapClassName | 对话框外层容器的类名 | string | - | |
|
||||||
| zIndex | 设置 Modal 的 `z-index` | Number | 1000 |
|
| zIndex | 设置 Modal 的 `z-index` | Number | 1000 | |
|
||||||
| onCancel | 点击遮罩层或右上角叉或取消按钮的回调 | function(e) | 无 |
|
| onCancel | 点击遮罩层或右上角叉或取消按钮的回调 | function(e) | 无 | |
|
||||||
| onOk | 点击确定回调 | function(e) | 无 |
|
| onOk | 点击确定回调 | function(e) | 无 | |
|
||||||
|
|
||||||
#### 注意
|
#### 注意
|
||||||
|
|
||||||
@ -60,26 +60,26 @@ title: Modal
|
|||||||
|
|
||||||
以上均为一个函数,参数为 object,具体属性如下:
|
以上均为一个函数,参数为 object,具体属性如下:
|
||||||
|
|
||||||
| 参数 | 说明 | 类型 | 默认值 |
|
| 参数 | 说明 | 类型 | 默认值 | 版本 |
|
||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- | --- |
|
||||||
| autoFocusButton | 指定自动获得焦点的按钮 | null\|string: `ok` `cancel` | `ok` |
|
| autoFocusButton | 指定自动获得焦点的按钮 | null\|string: `ok` `cancel` | `ok` | 3.10.0 |
|
||||||
| cancelText | 设置 Modal.confirm 取消按钮文字 | string | 取消 |
|
| cancelText | 设置 Modal.confirm 取消按钮文字 | string | 取消 | |
|
||||||
| centered | 垂直居中展示 Modal | Boolean | `false` |
|
| centered | 垂直居中展示 Modal | Boolean | `false` | 3.8.2 |
|
||||||
| className | 容器类名 | string | - |
|
| className | 容器类名 | string | - | 3.1.1 |
|
||||||
| content | 内容 | string\|ReactNode | 无 |
|
| content | 内容 | string\|ReactNode | 无 | |
|
||||||
| icon | 自定义图标(3.12.0 新增) | string\|ReactNode | `<Icon type="question-circle">` |
|
| icon | 自定义图标(3.12.0 新增) | string\|ReactNode | `<Icon type="question-circle">` | 3.12.0 |
|
||||||
| iconType | 图标类型(3.12.0 后废弃,请使用 `icon`) | string | `question-circle` |
|
| iconType | 图标类型(3.12.0 后废弃,请使用 `icon`) | string | `question-circle` | |
|
||||||
| mask | 是否展示遮罩 | Boolean | true |
|
| mask | 是否展示遮罩 | Boolean | true | 3.13.0 |
|
||||||
| maskClosable | 点击蒙层是否允许关闭 | Boolean | `false` |
|
| maskClosable | 点击蒙层是否允许关闭 | Boolean | `false` | |
|
||||||
| okText | 确认按钮文字 | string | 确定 |
|
| okText | 确认按钮文字 | string | 确定 | |
|
||||||
| okType | 确认按钮类型 | string | primary |
|
| okType | 确认按钮类型 | string | primary | |
|
||||||
| okButtonProps | ok 按钮 props | [ButtonProps](/components/button) | - |
|
| okButtonProps | ok 按钮 props | [ButtonProps](/components/button) | - | 3.10.0 |
|
||||||
| cancelButtonProps | cancel 按钮 props | [ButtonProps](/components/button) | - |
|
| cancelButtonProps | cancel 按钮 props | [ButtonProps](/components/button) | - | 3.10.0 |
|
||||||
| title | 标题 | string\|ReactNode | 无 |
|
| title | 标题 | string\|ReactNode | 无 | |
|
||||||
| width | 宽度 | string\|number | 416 |
|
| width | 宽度 | string\|number | 416 | |
|
||||||
| zIndex | 设置 Modal 的 `z-index` | Number | 1000 |
|
| zIndex | 设置 Modal 的 `z-index` | Number | 1000 | |
|
||||||
| onCancel | 取消回调,参数为关闭函数,返回 promise 时 resolve 后自动关闭 | function | 无 |
|
| onCancel | 取消回调,参数为关闭函数,返回 promise 时 resolve 后自动关闭 | function | 无 | |
|
||||||
| onOk | 点击确定回调,参数为关闭函数,返回 promise 时 resolve 后自动关闭 | function | 无 |
|
| onOk | 点击确定回调,参数为关闭函数,返回 promise 时 resolve 后自动关闭 | function | 无 | |
|
||||||
|
|
||||||
以上函数调用后,会返回一个引用,可以通过该引用更新和关闭弹窗。
|
以上函数调用后,会返回一个引用,可以通过该引用更新和关闭弹窗。
|
||||||
|
|
||||||
|
@ -28,22 +28,22 @@ To display a notification message at any of the four corners of the viewport. Ty
|
|||||||
|
|
||||||
The properties of config are as follows:
|
The properties of config are as follows:
|
||||||
|
|
||||||
| Property | Description | Type | Default |
|
| Property | Description | Type | Default | Version |
|
||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- | --- |
|
||||||
| bottom | Distance from the bottom of the viewport, when `placement` is `bottomRight` or `bottomLeft` (unit: pixels). | number | 24 |
|
| bottom | Distance from the bottom of the viewport, when `placement` is `bottomRight` or `bottomLeft` (unit: pixels). | number | 24 | |
|
||||||
| btn | Customized close button | ReactNode | - |
|
| btn | Customized close button | ReactNode | - | |
|
||||||
| className | Customized CSS class | string | - |
|
| className | Customized CSS class | string | - | |
|
||||||
| description | The content of notification box (required) | string\|ReactNode | - |
|
| description | The content of notification box (required) | string\|ReactNode | - | |
|
||||||
| duration | Time in seconds before Notification is closed. When set to 0 or null, it will never be closed automatically | number | 4.5 |
|
| duration | Time in seconds before Notification is closed. When set to 0 or null, it will never be closed automatically | number | 4.5 | |
|
||||||
| getContainer | Return the mount node for Notification | () => HTMLNode | () => document.body |
|
| getContainer | Return the mount node for Notification | () => HTMLNode | () => document.body | |
|
||||||
| icon | Customized icon | ReactNode | - |
|
| icon | Customized icon | ReactNode | - | |
|
||||||
| key | The unique identifier of the Notification | string | - |
|
| key | The unique identifier of the Notification | string | - | |
|
||||||
| message | The title of notification box (required) | string\|ReactNode | - |
|
| message | The title of notification box (required) | string\|ReactNode | - | |
|
||||||
| onClose | Specify a function that will be called when the close button is clicked | Function | - |
|
| onClose | Specify a function that will be called when the close button is clicked | Function | - | |
|
||||||
| onClick | Specify a function that will be called when the notification is clicked | Function | - |
|
| onClick | Specify a function that will be called when the notification is clicked | Function | - | 3.11.0 |
|
||||||
| placement | Position of Notification, can be one of `topLeft` `topRight` `bottomLeft` `bottomRight` | string | `topRight` |
|
| placement | Position of Notification, can be one of `topLeft` `topRight` `bottomLeft` `bottomRight` | string | `topRight` | |
|
||||||
| style | Customized inline style | [React.CSSProperties](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/e434515761b36830c3e58a970abf5186f005adac/types/react/index.d.ts#L794) | - |
|
| style | Customized inline style | [React.CSSProperties](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/e434515761b36830c3e58a970abf5186f005adac/types/react/index.d.ts#L794) | - | |
|
||||||
| top | Distance from the top of the viewport, when `placement` is `topRight` or `topLeft` (unit: pixels). | number | 24 |
|
| top | Distance from the top of the viewport, when `placement` is `topRight` or `topLeft` (unit: pixels). | number | 24 | |
|
||||||
|
|
||||||
`notification` also provides a global `config()` method that can be used for specifying the default options. Once this method is used, all the notification boxes will take into account these globally defined options when displaying.
|
`notification` also provides a global `config()` method that can be used for specifying the default options. Once this method is used, all the notification boxes will take into account these globally defined options when displaying.
|
||||||
|
|
||||||
@ -57,10 +57,10 @@ notification.config({
|
|||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
| Property | Description | Type | Default |
|
| Property | Description | Type | Default | Version |
|
||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- | --- |
|
||||||
| bottom | Distance from the bottom of the viewport, when `placement` is `bottomRight` or `bottomLeft` (unit: pixels). | number | 24 |
|
| bottom | Distance from the bottom of the viewport, when `placement` is `bottomRight` or `bottomLeft` (unit: pixels). | number | 24 | |
|
||||||
| duration | Time in seconds before Notification is closed. When set to 0 or null, it will never be closed automatically | number | 4.5 |
|
| duration | Time in seconds before Notification is closed. When set to 0 or null, it will never be closed automatically | number | 4.5 | |
|
||||||
| getContainer | Return the mount node for Notification | () => HTMLNode | () => document.body |
|
| getContainer | Return the mount node for Notification | () => HTMLNode | () => document.body | |
|
||||||
| placement | Position of Notification, can be one of `topLeft` `topRight` `bottomLeft` `bottomRight` | string | `topRight` |
|
| placement | Position of Notification, can be one of `topLeft` `topRight` `bottomLeft` `bottomRight` | string | `topRight` | |
|
||||||
| top | Distance from the top of the viewport, when `placement` is `topRight` or `topLeft` (unit: pixels). | number | 24 |
|
| top | Distance from the top of the viewport, when `placement` is `topRight` or `topLeft` (unit: pixels). | number | 24 | |
|
||||||
|
@ -29,22 +29,22 @@ subtitle: 通知提醒框
|
|||||||
|
|
||||||
config 参数如下:
|
config 参数如下:
|
||||||
|
|
||||||
| 参数 | 说明 | 类型 | 默认值 |
|
| 参数 | 说明 | 类型 | 默认值 | 版本 |
|
||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- | --- |
|
||||||
| btn | 自定义关闭按钮 | ReactNode | - |
|
| btn | 自定义关闭按钮 | ReactNode | - | |
|
||||||
| bottom | 消息从底部弹出时,距离底部的位置,单位像素。 | number | 24 |
|
| bottom | 消息从底部弹出时,距离底部的位置,单位像素。 | number | 24 | |
|
||||||
| className | 自定义 CSS class | string | - |
|
| className | 自定义 CSS class | string | - | |
|
||||||
| description | 通知提醒内容,必选 | string\|ReactNode | - |
|
| description | 通知提醒内容,必选 | string\|ReactNode | - | |
|
||||||
| duration | 默认 4.5 秒后自动关闭,配置为 null 则不自动关闭 | number | 4.5 |
|
| duration | 默认 4.5 秒后自动关闭,配置为 null 则不自动关闭 | number | 4.5 | |
|
||||||
| getContainer | 配置渲染节点的输出位置 | () => HTMLNode | () => document.body |
|
| getContainer | 配置渲染节点的输出位置 | () => HTMLNode | () => document.body | |
|
||||||
| icon | 自定义图标 | ReactNode | - |
|
| icon | 自定义图标 | ReactNode | - | |
|
||||||
| key | 当前通知唯一标志 | string | - |
|
| key | 当前通知唯一标志 | string | - | |
|
||||||
| message | 通知提醒标题,必选 | string\|ReactNode | - |
|
| message | 通知提醒标题,必选 | string\|ReactNode | - | |
|
||||||
| onClose | 点击默认关闭按钮时触发的回调函数 | Function | - |
|
| onClose | 点击默认关闭按钮时触发的回调函数 | Function | - | |
|
||||||
| onClick | 点击通知时触发的回调函数 | Function | - |
|
| onClick | 点击通知时触发的回调函数 | Function | - | 3.11.0 |
|
||||||
| placement | 弹出位置,可选 `topLeft` `topRight` `bottomLeft` `bottomRight` | string | topRight |
|
| placement | 弹出位置,可选 `topLeft` `topRight` `bottomLeft` `bottomRight` | string | topRight | |
|
||||||
| style | 自定义内联样式 | [React.CSSProperties](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/e434515761b36830c3e58a970abf5186f005adac/types/react/index.d.ts#L794) | - |
|
| style | 自定义内联样式 | [React.CSSProperties](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/e434515761b36830c3e58a970abf5186f005adac/types/react/index.d.ts#L794) | - | |
|
||||||
| top | 消息从顶部弹出时,距离顶部的位置,单位像素。 | number | 24 |
|
| top | 消息从顶部弹出时,距离顶部的位置,单位像素。 | number | 24 | |
|
||||||
|
|
||||||
还提供了一个全局配置方法,在调用前提前配置,全局一次生效。
|
还提供了一个全局配置方法,在调用前提前配置,全局一次生效。
|
||||||
|
|
||||||
@ -58,10 +58,10 @@ notification.config({
|
|||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
| 参数 | 说明 | 类型 | 默认值 |
|
| 参数 | 说明 | 类型 | 默认值 | 版本 |
|
||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- | --- |
|
||||||
| bottom | 消息从底部弹出时,距离底部的位置,单位像素。 | number | 24 |
|
| bottom | 消息从底部弹出时,距离底部的位置,单位像素。 | number | 24 | |
|
||||||
| duration | 默认自动关闭延时,单位秒 | number | 4.5 |
|
| duration | 默认自动关闭延时,单位秒 | number | 4.5 | |
|
||||||
| getContainer | 配置渲染节点的输出位置 | () => HTMLNode | () => document.body |
|
| getContainer | 配置渲染节点的输出位置 | () => HTMLNode | () => document.body | |
|
||||||
| placement | 弹出位置,可选 `topLeft` `topRight` `bottomLeft` `bottomRight` | string | topRight |
|
| placement | 弹出位置,可选 `topLeft` `topRight` `bottomLeft` `bottomRight` | string | topRight | |
|
||||||
| top | 消息从顶部弹出时,距离顶部的位置,单位像素。 | number | 24 |
|
| top | 消息从顶部弹出时,距离顶部的位置,单位像素。 | number | 24 | |
|
||||||
|
@ -14,13 +14,13 @@ It can also be used as inter-page navigation when it is needed to make the user
|
|||||||
|
|
||||||
## API
|
## API
|
||||||
|
|
||||||
| Param | Description | Type | Default value |
|
| Param | Description | Type | Default value | Version |
|
||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- | --- |
|
||||||
| title | custom title text | ReactNode | - |
|
| title | custom title text | ReactNode | - | 3.14.0 |
|
||||||
| subTitle | custom subTitle text | ReactNode | - |
|
| subTitle | custom subTitle text | ReactNode | - | 3.14.0 |
|
||||||
| backIcon | custom back icon, if false the back icon will not be displayed | ReactNode | `<Icon type="arrow-left" />` |
|
| backIcon | custom back icon, if false the back icon will not be displayed | ReactNode | `<Icon type="arrow-left" />` | 3.14.0 |
|
||||||
| tags | Tag list next to title | [Tag](https://ant.design/components/tag-cn/)[] \| [Tag](https://ant.design/components/tag-cn/) | - |
|
| tags | Tag list next to title | [Tag](https://ant.design/components/tag-cn/)[] \| [Tag](https://ant.design/components/tag-cn/) | - | 3.14.0 |
|
||||||
| extra | Operating area, at the end of the line of the title line | ReactNode | - |
|
| extra | Operating area, at the end of the line of the title line | ReactNode | - | 3.14.0 |
|
||||||
| breadcrumb | breadcrumb config | [breadcrumb](https://ant.design/components/breadcrumb-cn/) | - |
|
| breadcrumb | breadcrumb config | [breadcrumb](https://ant.design/components/breadcrumb-cn/) | - | 3.14.0 |
|
||||||
| footer | PageHeader's footer, generally used to render TabBar | ReactNode | - |
|
| footer | PageHeader's footer, generally used to render TabBar | ReactNode | - | 3.14.0 |
|
||||||
| onBack | back icon click event | `()=>void` | `()=>history.back()` |
|
| onBack | back icon click event | `()=>void` | `()=>history.back()` | 3.14.0 |
|
||||||
|
@ -14,13 +14,13 @@ subtitle: 页头
|
|||||||
|
|
||||||
## API
|
## API
|
||||||
|
|
||||||
| 参数 | 说明 | 类型 | 默认值 |
|
| 参数 | 说明 | 类型 | 默认值 | 版本 |
|
||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- | --- |
|
||||||
| title | 自定义标题文字 | ReactNode | - |
|
| title | 自定义标题文字 | ReactNode | - | 3.14.0 |
|
||||||
| subTitle | 自定义的二级标题文字 | ReactNode | - |
|
| subTitle | 自定义的二级标题文字 | ReactNode | - | 3.14.0 |
|
||||||
| backIcon | 自定义 back icon ,如果为 false 不渲染 back icon | ReactNode | `<Icon type="arrow-left" />` |
|
| backIcon | 自定义 back icon ,如果为 false 不渲染 back icon | ReactNode | `<Icon type="arrow-left" />` | 3.14.0 |
|
||||||
| tags | title 旁的 tag 列表 | [Tag](https://ant.design/components/tag-cn/)[] \| [Tag](https://ant.design/components/tag-cn/) | - |
|
| tags | title 旁的 tag 列表 | [Tag](https://ant.design/components/tag-cn/)[] \| [Tag](https://ant.design/components/tag-cn/) | - | 3.14.0 |
|
||||||
| extra | 操作区,位于 title 行的行尾 | ReactNode | - |
|
| extra | 操作区,位于 title 行的行尾 | ReactNode | - | 3.14.0 |
|
||||||
| breadcrumb | 面包屑的配置 | [breadcrumb](https://ant.design/components/breadcrumb-cn/) | - |
|
| breadcrumb | 面包屑的配置 | [breadcrumb](https://ant.design/components/breadcrumb-cn/) | - | 3.14.0 |
|
||||||
| footer | PageHeader 的页脚,一般用于渲染 TabBar | ReactNode | - |
|
| footer | PageHeader 的页脚,一般用于渲染 TabBar | ReactNode | - | 3.14.0 |
|
||||||
| onBack | 返回按钮的点击事件 | `()=>void` | `()=>history.back()` |
|
| onBack | 返回按钮的点击事件 | `()=>void` | `()=>history.back()` | 3.14.0 |
|
||||||
|
@ -24,14 +24,14 @@ A long list can be divided into several pages by `Pagination`, and only one page
|
|||||||
| defaultCurrent | default initial page number | number | 1 | |
|
| defaultCurrent | default initial page number | number | 1 | |
|
||||||
| defaultPageSize | default number of data items per page | number | 10 | |
|
| defaultPageSize | default number of data items per page | number | 10 | |
|
||||||
| disabled | disable pagination | boolean | - | 3.18.0 |
|
| disabled | disable pagination | boolean | - | 3.18.0 |
|
||||||
| hideOnSinglePage | Whether to hide pager on single page | boolean | false | |
|
| hideOnSinglePage | Whether to hide pager on single page | boolean | false | 3.1.0 |
|
||||||
| itemRender | to customize item innerHTML | (page, type: 'page' \| 'prev' \| 'next', originalElement) => React.ReactNode | - | |
|
| itemRender | to customize item innerHTML | (page, type: 'page' \| 'prev' \| 'next', originalElement) => React.ReactNode | - | |
|
||||||
| pageSize | number of data items per page | number | - | |
|
| pageSize | number of data items per page | number | - | |
|
||||||
| pageSizeOptions | specify the sizeChanger options | string\[] | \['10', '20', '30', '40'] | |
|
| pageSizeOptions | specify the sizeChanger options | string\[] | \['10', '20', '30', '40'] | |
|
||||||
| showLessItems | show less page items | boolean | false | |
|
| showLessItems | show less page items | boolean | false | 3.16.3 |
|
||||||
| showQuickJumper | determine whether you can jump to pages directly | boolean \| `{ goButton: ReactNode }` | false | |
|
| showQuickJumper | determine whether you can jump to pages directly | boolean \| `{ goButton: ReactNode }` | false | |
|
||||||
| showSizeChanger | determine whether `pageSize` can be changed | boolean | false | |
|
| showSizeChanger | determine whether `pageSize` can be changed | boolean | false | |
|
||||||
| showTitle | show page items title | boolean | true | |
|
| showTitle | show page items title | boolean | true | 3.19.3 |
|
||||||
| showTotal | to display the total number and range | Function(total, range) | - | |
|
| showTotal | to display the total number and range | Function(total, range) | - | |
|
||||||
| simple | whether to use simple mode | boolean | - | |
|
| simple | whether to use simple mode | boolean | - | |
|
||||||
| size | specify the size of `Pagination`, can be set to `small` | string | "" | |
|
| size | specify the size of `Pagination`, can be set to `small` | string | "" | |
|
||||||
|
@ -24,12 +24,12 @@ cols: 1
|
|||||||
| current | 当前页数 | number | - | |
|
| current | 当前页数 | number | - | |
|
||||||
| defaultCurrent | 默认的当前页数 | number | 1 | |
|
| defaultCurrent | 默认的当前页数 | number | 1 | |
|
||||||
| defaultPageSize | 默认的每页条数 | number | 10 | |
|
| defaultPageSize | 默认的每页条数 | number | 10 | |
|
||||||
| disabled | 禁用分页 | boolean | - | 3.10.0 |
|
| disabled | 禁用分页 | boolean | - | 3.10.0 | 3.18.0 |
|
||||||
| hideOnSinglePage | 只有一页时是否隐藏分页器 | boolean | false | |
|
| hideOnSinglePage | 只有一页时是否隐藏分页器 | boolean | false | 3.1.0 |
|
||||||
| itemRender | 用于自定义页码的结构,可用于优化 SEO | (page, type: 'page' \| 'prev' \| 'next', originalElement) => React.ReactNode | - | |
|
| itemRender | 用于自定义页码的结构,可用于优化 SEO | (page, type: 'page' \| 'prev' \| 'next', originalElement) => React.ReactNode | - | |
|
||||||
| pageSize | 每页条数 | number | - | |
|
| pageSize | 每页条数 | number | - | |
|
||||||
| pageSizeOptions | 指定每页可以显示多少条 | string\[] | \['10', '20', '30', '40'] | |
|
| pageSizeOptions | 指定每页可以显示多少条 | string\[] | \['10', '20', '30', '40'] | |
|
||||||
| showLessItems | show less page items | boolean | false | |
|
| showLessItems | show less page items | boolean | false | 3.16.3 |
|
||||||
| showQuickJumper | 是否可以快速跳转至某页 | boolean \| `{ goButton: ReactNode }` | false | |
|
| showQuickJumper | 是否可以快速跳转至某页 | boolean \| `{ goButton: ReactNode }` | false | |
|
||||||
| showSizeChanger | 是否可以改变 pageSize | boolean | false | |
|
| showSizeChanger | 是否可以改变 pageSize | boolean | false | |
|
||||||
| showTotal | 用于显示数据总量和当前数据顺序 | Function(total, range) | - | |
|
| showTotal | 用于显示数据总量和当前数据顺序 | Function(total, range) | - | |
|
||||||
|
@ -14,16 +14,16 @@ The difference with the `confirm` modal dialog is that it's more lightweight tha
|
|||||||
|
|
||||||
## API
|
## API
|
||||||
|
|
||||||
| Param | Description | Type | Default value |
|
| Param | Description | Type | Default value | Version |
|
||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- | --- |
|
||||||
| cancelText | text of the Cancel button | string | `Cancel` |
|
| cancelText | text of the Cancel button | string | `Cancel` | |
|
||||||
| okText | text of the Confirm button | string | `Confirm` |
|
| okText | text of the Confirm button | string | `Confirm` | |
|
||||||
| okType | Button `type` of the Confirm button | string | `primary` |
|
| okType | Button `type` of the Confirm button | string | `primary` | |
|
||||||
| title | title of the confirmation box | string\|ReactNode | - |
|
| title | title of the confirmation box | string\|ReactNode | - | |
|
||||||
| onCancel | callback of cancel | function(e) | - |
|
| onCancel | callback of cancel | function(e) | - | |
|
||||||
| onConfirm | callback of confirmation | function(e) | - |
|
| onConfirm | callback of confirmation | function(e) | - | |
|
||||||
| icon | customize icon of confirmation | ReactNode | <Icon type="exclamation-circle" /> |
|
| icon | customize icon of confirmation | ReactNode | <Icon type="exclamation-circle" /> | 3.8.0 |
|
||||||
| disabled | is show popconfirm when click its childrenNode | boolean | false |
|
| disabled | is show popconfirm when click its childrenNode | boolean | false | 3.19.8 |
|
||||||
|
|
||||||
Consult [Tooltip's documentation](https://ant.design/components/tooltip/#API) to find more APIs.
|
Consult [Tooltip's documentation](https://ant.design/components/tooltip/#API) to find more APIs.
|
||||||
|
|
||||||
|
@ -15,16 +15,16 @@ title: Popconfirm
|
|||||||
|
|
||||||
## API
|
## API
|
||||||
|
|
||||||
| 参数 | 说明 | 类型 | 默认值 |
|
| 参数 | 说明 | 类型 | 默认值 | 版本 |
|
||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- | --- |
|
||||||
| cancelText | 取消按钮文字 | string | 取消 |
|
| cancelText | 取消按钮文字 | string | 取消 | |
|
||||||
| okText | 确认按钮文字 | string | 确定 |
|
| okText | 确认按钮文字 | string | 确定 | |
|
||||||
| okType | 确认按钮类型 | string | primary |
|
| okType | 确认按钮类型 | string | primary | |
|
||||||
| title | 确认框的描述 | string\|ReactNode | 无 |
|
| title | 确认框的描述 | string\|ReactNode | 无 | |
|
||||||
| onCancel | 点击取消的回调 | function(e) | 无 |
|
| onCancel | 点击取消的回调 | function(e) | 无 | |
|
||||||
| onConfirm | 点击确认的回调 | function(e) | 无 |
|
| onConfirm | 点击确认的回调 | function(e) | 无 | |
|
||||||
| icon | 自定义弹出气泡 Icon 图标 | ReactNode | <Icon type="exclamation-circle" /> |
|
| icon | 自定义弹出气泡 Icon 图标 | ReactNode | <Icon type="exclamation-circle" /> | 3.8.0 |
|
||||||
| disabled | 点击 Popconfirm 子元素是否弹出气泡确认框 | boolean | false |
|
| disabled | 点击 Popconfirm 子元素是否弹出气泡确认框 | boolean | false | 3.19.8 |
|
||||||
|
|
||||||
更多属性请参考 [Tooltip](/components/tooltip/#API)。
|
更多属性请参考 [Tooltip](/components/tooltip/#API)。
|
||||||
|
|
||||||
|
@ -14,10 +14,10 @@ Comparing with `Tooltip`, besides information `Popover` card can also provide ac
|
|||||||
|
|
||||||
## API
|
## API
|
||||||
|
|
||||||
| Param | Description | Type | Default value |
|
| Param | Description | Type | Default value | Version |
|
||||||
| ------- | ------------------- | ----------------- | ------------- |
|
| ------- | ------------------- | ----------------- | ------------- | ------- |
|
||||||
| content | Content of the card | string\|ReactNode | - |
|
| content | Content of the card | string\|ReactNode | - | |
|
||||||
| title | Title of the card | string\|ReactNode | - |
|
| title | Title of the card | string\|ReactNode | - | |
|
||||||
|
|
||||||
Consult [Tooltip's documentation](https://ant.design/components/tooltip/#API) to find more APIs.
|
Consult [Tooltip's documentation](https://ant.design/components/tooltip/#API) to find more APIs.
|
||||||
|
|
||||||
|
@ -15,10 +15,10 @@ title: Popover
|
|||||||
|
|
||||||
## API
|
## API
|
||||||
|
|
||||||
| 参数 | 说明 | 类型 | 默认值 |
|
| 参数 | 说明 | 类型 | 默认值 | 版本 |
|
||||||
| ------- | -------- | ----------------- | ------ |
|
| ------- | -------- | ----------------- | ------ | ---- |
|
||||||
| content | 卡片内容 | string\|ReactNode | 无 |
|
| content | 卡片内容 | string\|ReactNode | 无 | |
|
||||||
| title | 卡片标题 | string\|ReactNode | 无 |
|
| title | 卡片标题 | string\|ReactNode | 无 | |
|
||||||
|
|
||||||
更多属性请参考 [Tooltip](/components/tooltip/#API)。
|
更多属性请参考 [Tooltip](/components/tooltip/#API)。
|
||||||
|
|
||||||
|
@ -17,37 +17,37 @@ If it will take a long time to complete an operation, you can use `Progress` to
|
|||||||
|
|
||||||
Properties that shared by all types.
|
Properties that shared by all types.
|
||||||
|
|
||||||
| Property | Description | Type | Default |
|
| Property | Description | Type | Default | Version |
|
||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- | --- |
|
||||||
| type | to set the type, options: `line` `circle` `dashboard` | string | `line` |
|
| type | to set the type, options: `line` `circle` `dashboard` | string | `line` | |
|
||||||
| format | template function of the content | function(percent, successPercent) | `percent => percent + '%'` |
|
| format | template function of the content | function(percent, successPercent) | `percent => percent + '%'` | |
|
||||||
| percent | to set the completion percentage | number | 0 |
|
| percent | to set the completion percentage | number | 0 | |
|
||||||
| showInfo | whether to display the progress value and the status icon | boolean | true |
|
| showInfo | whether to display the progress value and the status icon | boolean | true | |
|
||||||
| status | to set the status of the Progress, options: `success` `exception` `normal` `active`(line only) | string | - |
|
| status | to set the status of the Progress, options: `success` `exception` `normal` `active`(line only) | string | - | |
|
||||||
| strokeLinecap | to set the style of the progress linecap | Enum{ 'round', 'square' } | `round` |
|
| strokeLinecap | to set the style of the progress linecap | Enum{ 'round', 'square' } | `round` | 3.8.0 |
|
||||||
| strokeColor | color of progress bar | string | - |
|
| strokeColor | color of progress bar | string | - | 3.7.0 |
|
||||||
| successPercent | segmented success percent | number | 0 |
|
| successPercent | segmented success percent | number | 0 | 3.2.0 |
|
||||||
|
|
||||||
### `type="line"`
|
### `type="line"`
|
||||||
|
|
||||||
| Property | Description | Type | Default |
|
| Property | Description | Type | Default | Version |
|
||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- | --- |
|
||||||
| strokeWidth | to set the width of the progress bar, unit: `px` | number | 10 |
|
| strokeWidth | to set the width of the progress bar, unit: `px` | number | 10 | 3.13.1 |
|
||||||
| strokeColor | color of progress bar, render `linear-gradient` when passing an object | string \| { from: string; to: string; direction: string } | - |
|
| strokeColor | color of progress bar, render `linear-gradient` when passing an object | string \| { from: string; to: string; direction: string } | - | 3.16.0 |
|
||||||
|
|
||||||
### `type="circle"`
|
### `type="circle"`
|
||||||
|
|
||||||
| Property | Description | Type | Default |
|
| Property | Description | Type | Default | Version |
|
||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- | --- |
|
||||||
| width | to set the canvas width of the circular progress, unit: `px` | number | 132 |
|
| width | to set the canvas width of the circular progress, unit: `px` | number | 132 | 3.13.1 |
|
||||||
| strokeWidth | to set the width of the circular progress, unit: percentage of the canvas width | number | 6 |
|
| strokeWidth | to set the width of the circular progress, unit: percentage of the canvas width | number | 6 | 3.13.1 |
|
||||||
| strokeColor | color of circular progress, render `linear-gradient` when passing an object | string \| object | - |
|
| strokeColor | color of circular progress, render `linear-gradient` when passing an object | string \| object | - | 3.19.8 |
|
||||||
|
|
||||||
### `type="dashboard"`
|
### `type="dashboard"`
|
||||||
|
|
||||||
| Property | Description | Type | Default |
|
| Property | Description | Type | Default | Version |
|
||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- | --- |
|
||||||
| width | to set the canvas width of the dashboard progress, unit: `px` | number | 132 |
|
| width | to set the canvas width of the dashboard progress, unit: `px` | number | 132 | 3.13.1 |
|
||||||
| strokeWidth | to set the width of the dashboard progress, unit: percentage of the canvas width | number | 6 |
|
| strokeWidth | to set the width of the dashboard progress, unit: percentage of the canvas width | number | 6 | 3.13.1 |
|
||||||
| gapDegree | the gap degree of half circle, 0 ~ 360 | number | 0 |
|
| gapDegree | the gap degree of half circle, 0 ~ 360 | number | 0 | 3.13.1 |
|
||||||
| gapPosition | the gap position, options: `top` `bottom` `left` `right` | string | `top` |
|
| gapPosition | the gap position, options: `top` `bottom` `left` `right` | string | `top` | 3.13.1 |
|
||||||
|
@ -18,37 +18,37 @@ title: Progress
|
|||||||
|
|
||||||
各类型共用的属性。
|
各类型共用的属性。
|
||||||
|
|
||||||
| 属性 | 说明 | 类型 | 默认值 |
|
| 属性 | 说明 | 类型 | 默认值 | 版本 |
|
||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- | --- |
|
||||||
| type | 类型,可选 `line` `circle` `dashboard` | string | `line` |
|
| type | 类型,可选 `line` `circle` `dashboard` | string | `line` | |
|
||||||
| format | 内容的模板函数 | function(percent, successPercent) | `percent => percent + '%'` |
|
| format | 内容的模板函数 | function(percent, successPercent) | `percent => percent + '%'` | |
|
||||||
| percent | 百分比 | number | 0 |
|
| percent | 百分比 | number | 0 | |
|
||||||
| showInfo | 是否显示进度数值或状态图标 | boolean | true |
|
| showInfo | 是否显示进度数值或状态图标 | boolean | true | |
|
||||||
| status | 状态,可选:`success` `exception` `normal` `active`(仅限 line) | string | - |
|
| status | 状态,可选:`success` `exception` `normal` `active`(仅限 line) | string | - | |
|
||||||
| strokeLinecap | | Enum{ 'round', 'square' } | `round` |
|
| strokeLinecap | | Enum{ 'round', 'square' } | `round` | 3.8.0 |
|
||||||
| strokeColor | 进度条的色彩 | string | - |
|
| strokeColor | 进度条的色彩 | string | - | 3.7.0 |
|
||||||
| successPercent | 已完成的分段百分比 | number | 0 |
|
| successPercent | 已完成的分段百分比 | number | 0 | 3.2.0 |
|
||||||
|
|
||||||
### `type="line"`
|
### `type="line"`
|
||||||
|
|
||||||
| 属性 | 说明 | 类型 | 默认值 |
|
| 属性 | 说明 | 类型 | 默认值 | 版本 |
|
||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- | --- |
|
||||||
| strokeWidth | 进度条线的宽度,单位 px | number | 10 |
|
| strokeWidth | 进度条线的宽度,单位 px | number | 10 | 3.13.1 |
|
||||||
| strokeColor | 进度条的色彩,传入 object 时为渐变 | string \| { from: string; to: string; direction: string } | - |
|
| strokeColor | 进度条的色彩,传入 object 时为渐变 | string \| { from: string; to: string; direction: string } | - | 3.16.0 |
|
||||||
|
|
||||||
### `type="circle"`
|
### `type="circle"`
|
||||||
|
|
||||||
| 属性 | 说明 | 类型 | 默认值 |
|
| 属性 | 说明 | 类型 | 默认值 | 版本 |
|
||||||
| ----------- | ------------------------------------------------ | ------ | ------ |
|
| --- | --- | --- | --- | --- |
|
||||||
| width | 圆形进度条画布宽度,单位 px | number | 132 |
|
| width | 圆形进度条画布宽度,单位 px | number | 132 | 3.13.1 |
|
||||||
| strokeWidth | 圆形进度条线的宽度,单位是进度条画布宽度的百分比 | number | 6 |
|
| strokeWidth | 圆形进度条线的宽度,单位是进度条画布宽度的百分比 | number | 6 | 3.13.1 |
|
||||||
| strokeColor | 圆形进度条线的色彩,传入 object 时为渐变 | string \| object | - |
|
| strokeColor | 圆形进度条线的色彩,传入 object 时为渐变 | string \| object | - | 3.19.8 |
|
||||||
|
|
||||||
### `type="dashboard"`
|
### `type="dashboard"`
|
||||||
|
|
||||||
| 属性 | 说明 | 类型 | 默认值 |
|
| 属性 | 说明 | 类型 | 默认值 | 版本 |
|
||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- | --- |
|
||||||
| width | 仪表盘进度条画布宽度,单位 px | number | 132 |
|
| width | 仪表盘进度条画布宽度,单位 px | number | 132 | 3.13.1 |
|
||||||
| strokeWidth | 仪表盘进度条线的宽度,单位是进度条画布宽度的百分比 | number | 6 |
|
| strokeWidth | 仪表盘进度条线的宽度,单位是进度条画布宽度的百分比 | number | 6 | 3.13.1 |
|
||||||
| gapDegree | 仪表盘进度条缺口角度,可取值 0 ~ 360 | number | 0 |
|
| gapDegree | 仪表盘进度条缺口角度,可取值 0 ~ 360 | number | 0 | 3.13.1 |
|
||||||
| gapPosition | 仪表盘进度条缺口位置 | Enum{ 'top', 'bottom', 'left', 'right' } | `top` |
|
| gapPosition | 仪表盘进度条缺口位置 | Enum{ 'top', 'bottom', 'left', 'right' } | `top` | 3.13.1 |
|
||||||
|
@ -15,34 +15,34 @@ Radio.
|
|||||||
|
|
||||||
### Radio
|
### Radio
|
||||||
|
|
||||||
| Property | Description | Type | Default |
|
| Property | Description | Type | Default | Version |
|
||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- | --- |
|
||||||
| autoFocus | get focus when component mounted | boolean | false |
|
| autoFocus | get focus when component mounted | boolean | false | |
|
||||||
| checked | Specifies whether the radio is selected. | boolean | - |
|
| checked | Specifies whether the radio is selected. | boolean | - | |
|
||||||
| defaultChecked | Specifies the initial state: whether or not 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 |
|
| 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
|
### RadioGroup
|
||||||
|
|
||||||
Radio group can wrap a group of `Radio`。
|
Radio group can wrap a group of `Radio`。
|
||||||
|
|
||||||
| Property | Description | Type | Default |
|
| Property | Description | Type | Default | Version |
|
||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- | --- |
|
||||||
| defaultValue | Default selected value | any | - |
|
| defaultValue | Default selected value | any | - | |
|
||||||
| disabled | Disable all radio buttons | boolean | false |
|
| disabled | Disable all radio buttons | boolean | false | |
|
||||||
| name | The `name` property of all `input[type="radio"]` children | string | - |
|
| name | The `name` property of all `input[type="radio"]` children | string | - | |
|
||||||
| options | set children optional | string\[] \| Array<{ label: string value: string disabled?: boolean }> | - |
|
| options | set children optional | string\[] \| Array<{ label: string value: string disabled?: boolean }> | - | |
|
||||||
| size | size for radio button style | `large` \| `default` \| `small` | `default` |
|
| size | size for radio button style | `large` \| `default` \| `small` | `default` | |
|
||||||
| value | Used for setting the currently selected value. | any | - |
|
| value | Used for setting the currently selected value. | any | - | |
|
||||||
| onChange | The callback function that is triggered when the state changes. | Function(e:Event) | - |
|
| onChange | The callback function that is triggered when the state changes. | Function(e:Event) | - | |
|
||||||
| buttonStyle | style type of radio button | `outline` \| `solid` | `outline` |
|
| buttonStyle | style type of radio button | `outline` \| `solid` | `outline` | 3.7.0 |
|
||||||
|
|
||||||
## Methods
|
## Methods
|
||||||
|
|
||||||
### Radio
|
### Radio
|
||||||
|
|
||||||
| Name | Description |
|
| Name | Description | Version |
|
||||||
| ------- | ------------ |
|
| ------- | ------------ | ------- |
|
||||||
| blur() | remove focus |
|
| blur() | remove focus | |
|
||||||
| focus() | get focus |
|
| focus() | get focus | |
|
||||||
|
@ -16,33 +16,33 @@ title: Radio
|
|||||||
|
|
||||||
### Radio
|
### Radio
|
||||||
|
|
||||||
| 参数 | 说明 | 类型 | 默认值 |
|
| 参数 | 说明 | 类型 | 默认值 | 版本 |
|
||||||
| -------------- | --------------------------------- | ------- | ------ |
|
| -------------- | --------------------------------- | ------- | ------ | ---- |
|
||||||
| autoFocus | 自动获取焦点 | boolean | false |
|
| autoFocus | 自动获取焦点 | boolean | false | |
|
||||||
| checked | 指定当前是否选中 | boolean | false |
|
| checked | 指定当前是否选中 | boolean | false | |
|
||||||
| defaultChecked | 初始是否选中 | boolean | false |
|
| defaultChecked | 初始是否选中 | boolean | false | |
|
||||||
| value | 根据 value 进行比较,判断是否选中 | any | - |
|
| value | 根据 value 进行比较,判断是否选中 | any | - | |
|
||||||
|
|
||||||
### RadioGroup
|
### RadioGroup
|
||||||
|
|
||||||
单选框组合,用于包裹一组 `Radio`。
|
单选框组合,用于包裹一组 `Radio`。
|
||||||
|
|
||||||
| 参数 | 说明 | 类型 | 默认值 |
|
| 参数 | 说明 | 类型 | 默认值 | 版本 |
|
||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- | --- |
|
||||||
| defaultValue | 默认选中的值 | any | - |
|
| defaultValue | 默认选中的值 | any | - | |
|
||||||
| disabled | 禁选所有子单选器 | boolean | false |
|
| disabled | 禁选所有子单选器 | boolean | false | 3.6.5 |
|
||||||
| name | RadioGroup 下所有 `input[type="radio"]` 的 `name` 属性 | string | - |
|
| name | RadioGroup 下所有 `input[type="radio"]` 的 `name` 属性 | string | - | |
|
||||||
| options | 以配置形式设置子元素 | string\[] \| Array<{ label: string value: string disabled?: boolean }> | - |
|
| options | 以配置形式设置子元素 | string\[] \| Array<{ label: string value: string disabled?: boolean }> | - | |
|
||||||
| size | 大小,只对按钮样式生效 | `large` \| `default` \| `small` | `default` |
|
| size | 大小,只对按钮样式生效 | `large` \| `default` \| `small` | `default` | |
|
||||||
| value | 用于设置当前选中的值 | any | - |
|
| value | 用于设置当前选中的值 | any | - | |
|
||||||
| onChange | 选项变化时的回调函数 | Function(e:Event) | - |
|
| onChange | 选项变化时的回调函数 | Function(e:Event) | - | |
|
||||||
| buttonStyle | RadioButton 的风格样式,目前有描边和填色两种风格 | `outline` \| `solid` | `outline` |
|
| buttonStyle | RadioButton 的风格样式,目前有描边和填色两种风格 | `outline` \| `solid` | `outline` | 3.7.0 |
|
||||||
|
|
||||||
## 方法
|
## 方法
|
||||||
|
|
||||||
### Radio
|
### Radio
|
||||||
|
|
||||||
| 名称 | 描述 |
|
| 名称 | 描述 | 版本 |
|
||||||
| ------- | -------- |
|
| ------- | -------- | ---- |
|
||||||
| blur() | 移除焦点 |
|
| blur() | 移除焦点 | |
|
||||||
| focus() | 获取焦点 |
|
| focus() | 获取焦点 | |
|
||||||
|
@ -13,28 +13,28 @@ Rate component.
|
|||||||
|
|
||||||
## API
|
## API
|
||||||
|
|
||||||
| Property | Description | type | Default |
|
| Property | Description | type | Default | Version |
|
||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- | --- |
|
||||||
| allowClear | whether to allow clear when click again | boolean | true |
|
| allowClear | whether to allow clear when click again | boolean | true | 3.1.0 |
|
||||||
| allowHalf | whether to allow semi selection | boolean | false |
|
| allowHalf | whether to allow semi selection | boolean | false | |
|
||||||
| autoFocus | get focus when component mounted | boolean | false |
|
| autoFocus | get focus when component mounted | boolean | false | |
|
||||||
| character | custom character of rate | ReactNode | `<Icon type="star" />` |
|
| character | custom character of rate | ReactNode | `<Icon type="star" />` | |
|
||||||
| className | custom class name of rate | string | - |
|
| className | custom class name of rate | string | - | |
|
||||||
| count | star count | number | 5 |
|
| count | star count | number | 5 | |
|
||||||
| defaultValue | default value | number | 0 |
|
| defaultValue | default value | number | 0 | |
|
||||||
| disabled | read only, unable to interact | boolean | false |
|
| disabled | read only, unable to interact | boolean | false | |
|
||||||
| style | custom style object of rate | object | - |
|
| style | custom style object of rate | object | - | |
|
||||||
| tooltips | Customize tooltip by each character | string\[] | - |
|
| tooltips | Customize tooltip by each character | string\[] | - | 3.12.0 |
|
||||||
| value | current value | number | - |
|
| value | current value | number | - | |
|
||||||
| onBlur | callback when component lose focus | Function() | - |
|
| onBlur | callback when component lose focus | Function() | - | |
|
||||||
| onChange | callback when select value | Function(value: number) | - |
|
| onChange | callback when select value | Function(value: number) | - | |
|
||||||
| onFocus | callback when component get focus | Function() | - |
|
| onFocus | callback when component get focus | Function() | - | |
|
||||||
| onHoverChange | callback when hover item | Function(value: number) | - |
|
| onHoverChange | callback when hover item | Function(value: number) | - | |
|
||||||
| onKeyDown | callback when keydown on component | Function(event) | - |
|
| onKeyDown | callback when keydown on component | Function(event) | - | |
|
||||||
|
|
||||||
## Methods
|
## Methods
|
||||||
|
|
||||||
| Name | Description |
|
| Name | Description | Version |
|
||||||
| ------- | ------------ |
|
| ------- | ------------ | ------- |
|
||||||
| blur() | remove focus |
|
| blur() | remove focus | |
|
||||||
| focus() | get focus |
|
| focus() | get focus | |
|
||||||
|
@ -14,28 +14,28 @@ title: Rate
|
|||||||
|
|
||||||
## API
|
## API
|
||||||
|
|
||||||
| 属性 | 说明 | 类型 | 默认值 |
|
| 属性 | 说明 | 类型 | 默认值 | 版本 |
|
||||||
| ------------- | ------------------------ | ----------------------- | ---------------------- |
|
| --- | --- | --- | --- | --- |
|
||||||
| allowClear | 是否允许再次点击后清除 | boolean | true |
|
| allowClear | 是否允许再次点击后清除 | boolean | true | 3.1.0 |
|
||||||
| allowHalf | 是否允许半选 | boolean | false |
|
| allowHalf | 是否允许半选 | boolean | false | |
|
||||||
| autoFocus | 自动获取焦点 | boolean | false |
|
| autoFocus | 自动获取焦点 | boolean | false | |
|
||||||
| character | 自定义字符 | ReactNode | `<Icon type="star" />` |
|
| character | 自定义字符 | ReactNode | `<Icon type="star" />` | |
|
||||||
| className | 自定义样式类名 | string | - |
|
| className | 自定义样式类名 | string | - | |
|
||||||
| count | star 总数 | number | 5 |
|
| count | star 总数 | number | 5 | |
|
||||||
| defaultValue | 默认值 | number | 0 |
|
| defaultValue | 默认值 | number | 0 | |
|
||||||
| disabled | 只读,无法进行交互 | boolean | false |
|
| disabled | 只读,无法进行交互 | boolean | false | |
|
||||||
| style | 自定义样式对象 | object | - |
|
| style | 自定义样式对象 | object | - | |
|
||||||
| tooltips | 自定义每项的提示信息 | string\[] | - |
|
| tooltips | 自定义每项的提示信息 | string\[] | - | 3.12.0 |
|
||||||
| value | 当前数,受控值 | number | - |
|
| value | 当前数,受控值 | number | - | |
|
||||||
| onBlur | 失去焦点时的回调 | Function() | - |
|
| onBlur | 失去焦点时的回调 | Function() | - | |
|
||||||
| onChange | 选择时的回调 | Function(value: number) | - |
|
| onChange | 选择时的回调 | Function(value: number) | - | |
|
||||||
| onFocus | 获取焦点时的回调 | Function() | - |
|
| onFocus | 获取焦点时的回调 | Function() | - | |
|
||||||
| onHoverChange | 鼠标经过时数值变化的回调 | Function(value: number) | - |
|
| onHoverChange | 鼠标经过时数值变化的回调 | Function(value: number) | - | |
|
||||||
| onKeyDown | 按键回调 | Function(event) | - |
|
| onKeyDown | 按键回调 | Function(event) | - | |
|
||||||
|
|
||||||
## 方法
|
## 方法
|
||||||
|
|
||||||
| 名称 | 描述 |
|
| 名称 | 描述 | 版本 |
|
||||||
| ------- | -------- |
|
| ------- | -------- | ---- |
|
||||||
| blur() | 移除焦点 |
|
| blur() | 移除焦点 | |
|
||||||
| focus() | 获取焦点 |
|
| focus() | 获取焦点 | |
|
||||||
|
@ -21,74 +21,74 @@ Select component to select value from options.
|
|||||||
|
|
||||||
### Select props
|
### Select props
|
||||||
|
|
||||||
| Property | Description | Type | Default |
|
| Property | Description | Type | Default | Version |
|
||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- | --- |
|
||||||
| allowClear | Show clear button. | boolean | false |
|
| allowClear | Show clear button. | boolean | false | |
|
||||||
| autoClearSearchValue | Whether the current search will be cleared on selecting an item. Only applies when `mode` is set to `multiple` or `tags`. | boolean | true |
|
| autoClearSearchValue | Whether the current search will be cleared on selecting an item. Only applies when `mode` is set to `multiple` or `tags`. | boolean | true | 3.10.0 |
|
||||||
| autoFocus | Get focus by default | boolean | false |
|
| autoFocus | Get focus by default | boolean | false | |
|
||||||
| defaultActiveFirstOption | Whether active first option by default | boolean | true |
|
| defaultActiveFirstOption | Whether active first option by default | boolean | true | |
|
||||||
| defaultValue | Initial selected option. | string\|string\[]<br />number\|number\[]<br />LabeledValue\|LabeledValue[] | - |
|
| defaultValue | Initial selected option. | string\|string\[]<br />number\|number\[]<br />LabeledValue\|LabeledValue[] | - | |
|
||||||
| disabled | Whether disabled select | boolean | false |
|
| disabled | Whether disabled select | boolean | false | |
|
||||||
| dropdownClassName | className of dropdown menu | string | - |
|
| dropdownClassName | className of dropdown menu | string | - | |
|
||||||
| dropdownMatchSelectWidth | Whether dropdown's width is same with select. | boolean | true |
|
| dropdownMatchSelectWidth | Whether dropdown's width is same with select. | boolean | true | |
|
||||||
| dropdownRender | Customize dropdown content | (menuNode: ReactNode, props) => ReactNode | - |
|
| dropdownRender | Customize dropdown content | (menuNode: ReactNode, props) => ReactNode | - | 3.11.0 |
|
||||||
| dropdownStyle | style of dropdown menu | object | - |
|
| dropdownStyle | style of dropdown menu | object | - | |
|
||||||
| filterOption | If true, filter options by input, if function, filter options against it. The function will receive two arguments, `inputValue` and `option`, if the function returns `true`, the option will be included in the filtered set; Otherwise, it will be excluded. | boolean or function(inputValue, option) | true |
|
| filterOption | If true, filter options by input, if function, filter options against it. The function will receive two arguments, `inputValue` and `option`, if the function returns `true`, the option will be included in the filtered set; Otherwise, it will be excluded. | boolean or function(inputValue, option) | true | |
|
||||||
| firstActiveValue | Value of action option by default | string\|string\[] | - |
|
| firstActiveValue | Value of action option by default | string\|string\[] | - | |
|
||||||
| getPopupContainer | Parent Node which the selector should be rendered to. Default to `body`. When position issues happen, try to modify it into scrollable content and position it relative. [Example](https://codesandbox.io/s/4j168r7jw0) | function(triggerNode) | () => document.body |
|
| getPopupContainer | Parent Node which the selector should be rendered to. Default to `body`. When position issues happen, try to modify it into scrollable content and position it relative. [Example](https://codesandbox.io/s/4j168r7jw0) | function(triggerNode) | () => document.body | |
|
||||||
| labelInValue | whether to embed label in value, turn the format of value from `string` to `{key: string, label: ReactNode}` | boolean | false |
|
| labelInValue | whether to embed label in value, turn the format of value from `string` to `{key: string, label: ReactNode}` | boolean | false | |
|
||||||
| maxTagCount | Max tag count to show | number | - |
|
| maxTagCount | Max tag count to show | number | - | |
|
||||||
| maxTagTextLength | Max tag count to show | number | - |
|
| maxTagTextLength | Max tag count to show | number | - | 3.18.0 |
|
||||||
| maxTagPlaceholder | Placeholder for not showing tags | ReactNode/function(omittedValues) | - |
|
| maxTagPlaceholder | Placeholder for not showing tags | ReactNode/function(omittedValues) | - | |
|
||||||
| mode | Set mode of Select | 'default' \| 'multiple' \| 'tags' | 'default' |
|
| mode | Set mode of Select | 'default' \| 'multiple' \| 'tags' | 'default' | |
|
||||||
| notFoundContent | Specify content to show when no result matches.. | string | 'Not Found' |
|
| notFoundContent | Specify content to show when no result matches.. | string | 'Not Found' | |
|
||||||
| optionFilterProp | Which prop value of option will be used for filter if filterOption is true | string | value |
|
| optionFilterProp | Which prop value of option will be used for filter if filterOption is true | string | value | |
|
||||||
| optionLabelProp | Which prop value of option will render as content of select. [Example](https://codesandbox.io/s/antd-reproduction-template-tk678) | string | `value` for `combobox`, `children` for other modes |
|
| optionLabelProp | Which prop value of option will render as content of select. [Example](https://codesandbox.io/s/antd-reproduction-template-tk678) | string | `value` for `combobox`, `children` for other modes | |
|
||||||
| placeholder | Placeholder of select | string\|ReactNode | - |
|
| placeholder | Placeholder of select | string\|ReactNode | - | |
|
||||||
| showArrow | Whether to show the drop-down arrow | boolean | true |
|
| showArrow | Whether to show the drop-down arrow | boolean | true | 3.2.1 |
|
||||||
| showSearch | Whether show search input in single mode. | boolean | false |
|
| showSearch | Whether show search input in single mode. | boolean | false | |
|
||||||
| size | Size of Select input. `default` `large` `small` | string | default |
|
| size | Size of Select input. `default` `large` `small` | string | default | |
|
||||||
| suffixIcon | The custom suffix icon | ReactNode | - |
|
| suffixIcon | The custom suffix icon | ReactNode | - | 3.10.0 |
|
||||||
| removeIcon | The custom remove icon | ReactNode | - |
|
| removeIcon | The custom remove icon | ReactNode | - | 3.11.0 |
|
||||||
| clearIcon | The custom clear icon | ReactNode | - |
|
| clearIcon | The custom clear icon | ReactNode | - | 3.11.0 |
|
||||||
| menuItemSelectedIcon | The custom menuItemSelected icon with multiple options | ReactNode | - |
|
| menuItemSelectedIcon | The custom menuItemSelected icon with multiple options | ReactNode | - | 3.11.0 |
|
||||||
| tokenSeparators | Separator used to tokenize on tag/multiple mode | string\[] | |
|
| tokenSeparators | Separator used to tokenize on tag/multiple mode | string\[] | | |
|
||||||
| value | Current selected option. | string\|string\[]\<br />number\|number\[]\<br />LabeledValue\|LabeledValue[] | - |
|
| value | Current selected option. | string\|string\[]\<br />number\|number\[]\<br />LabeledValue\|LabeledValue[] | - | |
|
||||||
| onBlur | Called when blur | function | - |
|
| onBlur | Called when blur | function | - | |
|
||||||
| onChange | Called when select an option or input value change, or value of input is changed in combobox mode | function(value, option:Option/Array<Option>) | - |
|
| onChange | Called when select an option or input value change, or value of input is changed in combobox mode | function(value, option:Option/Array<Option>) | - | |
|
||||||
| onDeselect | Called when a option is deselected, param is the selected option's value. Only called for multiple or tags, effective in multiple or tags mode only. | function(string\|number\|LabeledValue) | - |
|
| onDeselect | Called when a option is deselected, param is the selected option's value. Only called for multiple or tags, effective in multiple or tags mode only. | function(string\|number\|LabeledValue) | - | |
|
||||||
| onFocus | Called when focus | function | - |
|
| onFocus | Called when focus | function | - | |
|
||||||
| onInputKeyDown | Called when key pressed | function | - |
|
| onInputKeyDown | Called when key pressed | function | - | 3.1.0 |
|
||||||
| onMouseEnter | Called when mouse enter | function | - |
|
| onMouseEnter | Called when mouse enter | function | - | |
|
||||||
| onMouseLeave | Called when mouse leave | function | - |
|
| onMouseLeave | Called when mouse leave | function | - | |
|
||||||
| onPopupScroll | Called when dropdown scrolls | function | - |
|
| onPopupScroll | Called when dropdown scrolls | function | - | |
|
||||||
| onSearch | Callback function that is fired when input changed. | function(value: string) | |
|
| onSearch | Callback function that is fired when input changed. | function(value: string) | | |
|
||||||
| onSelect | Called when a option is selected, the params are option's value (or key) and option instance. | function(string\|number\|LabeledValue, option:Option) | - |
|
| onSelect | Called when a option is selected, the params are option's value (or key) and option instance. | function(string\|number\|LabeledValue, option:Option) | - | |
|
||||||
| defaultOpen | Initial open state of dropdown | boolean | - |
|
| defaultOpen | Initial open state of dropdown | boolean | - | 3.9.3 |
|
||||||
| open | Controlled open state of dropdown | boolean | - |
|
| open | Controlled open state of dropdown | boolean | - | 3.9.0 |
|
||||||
| onDropdownVisibleChange | Call when dropdown open (Supported after version 3.9.0) | function(open) | - |
|
| onDropdownVisibleChange | Call when dropdown open (Supported after version 3.9.0) | function(open) | - | 3.9.0 |
|
||||||
| loading | indicate loading state | Boolean | false |
|
| loading | indicate loading state | Boolean | false | 3.11.0 |
|
||||||
|
|
||||||
### Select Methods
|
### Select Methods
|
||||||
|
|
||||||
| Name | Description |
|
| Name | Description | Version |
|
||||||
| ------- | ------------ |
|
| ------- | ------------ | ------- |
|
||||||
| blur() | Remove focus |
|
| blur() | Remove focus | |
|
||||||
| focus() | Get focus |
|
| focus() | Get focus | |
|
||||||
|
|
||||||
### Option props
|
### Option props
|
||||||
|
|
||||||
| Property | Description | Type | Default |
|
| Property | Description | Type | Default | Version |
|
||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- | --- |
|
||||||
| disabled | Disable this option | boolean | false |
|
| disabled | Disable this option | boolean | false | |
|
||||||
| key | Same usage as `value`. If React request you to set this property, you can set it to value of option, and then omit value property. | string | |
|
| key | Same usage as `value`. If React request you to set this property, you can set it to value of option, and then omit value property. | string | | |
|
||||||
| title | `title` of Select after select this Option | string | - |
|
| title | `title` of Select after select this Option | string | - | |
|
||||||
| value | default to filter with this property | string\|number | - |
|
| value | default to filter with this property | string\|number | - | |
|
||||||
| className | additional class to option | string | - |
|
| className | additional class to option | string | - | 3.10.1 |
|
||||||
|
|
||||||
### OptGroup props
|
### OptGroup props
|
||||||
|
|
||||||
| Property | Description | Type | Default |
|
| Property | Description | Type | Default | Version |
|
||||||
| -------- | ----------- | --------------------- | ------- |
|
| -------- | ----------- | --------------------- | ------- | ------- |
|
||||||
| key | | string | - |
|
| key | | string | - | |
|
||||||
| label | Group label | string\|React.Element | - |
|
| label | Group label | string\|React.Element | - | |
|
||||||
|
@ -22,75 +22,75 @@ title: Select
|
|||||||
|
|
||||||
### Select props
|
### Select props
|
||||||
|
|
||||||
| 参数 | 说明 | 类型 | 默认值 |
|
| 参数 | 说明 | 类型 | 默认值 | 版本 |
|
||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- | --- |
|
||||||
| allowClear | 支持清除 | boolean | false |
|
| allowClear | 支持清除 | boolean | false | |
|
||||||
| autoClearSearchValue | 是否在选中项后清空搜索框,只在 `mode` 为 `multiple` 或 `tags` 时有效。 | boolean | true |
|
| autoClearSearchValue | 是否在选中项后清空搜索框,只在 `mode` 为 `multiple` 或 `tags` 时有效。 | boolean | true | 3.10.0 |
|
||||||
| autoFocus | 默认获取焦点 | boolean | false |
|
| autoFocus | 默认获取焦点 | boolean | false | |
|
||||||
| defaultActiveFirstOption | 是否默认高亮第一个选项。 | boolean | true |
|
| defaultActiveFirstOption | 是否默认高亮第一个选项。 | boolean | true | |
|
||||||
| defaultValue | 指定默认选中的条目 | string\|string\[]\<br />number\|number\[]\<br />LabeledValue\|LabeledValue[] | - |
|
| defaultValue | 指定默认选中的条目 | string\|string\[]\<br />number\|number\[]\<br />LabeledValue\|LabeledValue[] | - | |
|
||||||
| disabled | 是否禁用 | boolean | false |
|
| disabled | 是否禁用 | boolean | false | |
|
||||||
| dropdownClassName | 下拉菜单的 className 属性 | string | - |
|
| dropdownClassName | 下拉菜单的 className 属性 | string | - | |
|
||||||
| dropdownMatchSelectWidth | 下拉菜单和选择器同宽 | boolean | true |
|
| dropdownMatchSelectWidth | 下拉菜单和选择器同宽 | boolean | true | |
|
||||||
| dropdownRender | 自定义下拉框内容 | (menuNode: ReactNode, props) => ReactNode | - |
|
| dropdownRender | 自定义下拉框内容 | (menuNode: ReactNode, props) => ReactNode | - | 3.11.0 |
|
||||||
| dropdownStyle | 下拉菜单的 style 属性 | object | - |
|
| dropdownStyle | 下拉菜单的 style 属性 | object | - | |
|
||||||
| filterOption | 是否根据输入项进行筛选。当其为一个函数时,会接收 `inputValue` `option` 两个参数,当 `option` 符合筛选条件时,应返回 `true`,反之则返回 `false`。 | boolean or function(inputValue, option) | true |
|
| filterOption | 是否根据输入项进行筛选。当其为一个函数时,会接收 `inputValue` `option` 两个参数,当 `option` 符合筛选条件时,应返回 `true`,反之则返回 `false`。 | boolean or function(inputValue, option) | true | |
|
||||||
| firstActiveValue | 默认高亮的选项 | string\|string\[] | - |
|
| firstActiveValue | 默认高亮的选项 | string\|string\[] | - | |
|
||||||
| getPopupContainer | 菜单渲染父节点。默认渲染到 body 上,如果你遇到菜单滚动定位问题,试试修改为滚动的区域,并相对其定位。[示例](https://codesandbox.io/s/4j168r7jw0) | Function(triggerNode) | () => document.body |
|
| getPopupContainer | 菜单渲染父节点。默认渲染到 body 上,如果你遇到菜单滚动定位问题,试试修改为滚动的区域,并相对其定位。[示例](https://codesandbox.io/s/4j168r7jw0) | Function(triggerNode) | () => document.body | |
|
||||||
| labelInValue | 是否把每个选项的 label 包装到 value 中,会把 Select 的 value 类型从 `string` 变为 `{key: string, label: ReactNode}` 的格式 | boolean | false |
|
| labelInValue | 是否把每个选项的 label 包装到 value 中,会把 Select 的 value 类型从 `string` 变为 `{key: string, label: ReactNode}` 的格式 | boolean | false | |
|
||||||
| maxTagCount | 最多显示多少个 tag | number | - |
|
| maxTagCount | 最多显示多少个 tag | number | - | |
|
||||||
| maxTagTextLength | 最大显示的 tag 文本长度 | number | - |
|
| maxTagTextLength | 最大显示的 tag 文本长度 | number | - | 3.18.0 |
|
||||||
| maxTagPlaceholder | 隐藏 tag 时显示的内容 | ReactNode/function(omittedValues) | - |
|
| maxTagPlaceholder | 隐藏 tag 时显示的内容 | ReactNode/function(omittedValues) | - | |
|
||||||
| mode | 设置 Select 的模式为多选或标签 | 'multiple' \| 'tags' | - |
|
| mode | 设置 Select 的模式为多选或标签 | 'multiple' \| 'tags' | - | |
|
||||||
| notFoundContent | 当下拉列表为空时显示的内容 | string | 'Not Found' |
|
| notFoundContent | 当下拉列表为空时显示的内容 | string | 'Not Found' | |
|
||||||
| optionFilterProp | 搜索时过滤对应的 option 属性,如设置为 children 表示对内嵌内容进行搜索。[示例](https://codesandbox.io/s/antd-reproduction-template-tk678) | string | value |
|
| optionFilterProp | 搜索时过滤对应的 option 属性,如设置为 children 表示对内嵌内容进行搜索。[示例](https://codesandbox.io/s/antd-reproduction-template-tk678) | string | value | |
|
||||||
| optionLabelProp | 回填到选择框的 Option 的属性值,默认是 Option 的子元素。比如在子元素需要高亮效果时,此值可以设为 `value`。 | string | `children` (combobox 模式下为 `value`) |
|
| optionLabelProp | 回填到选择框的 Option 的属性值,默认是 Option 的子元素。比如在子元素需要高亮效果时,此值可以设为 `value`。 | string | `children` (combobox 模式下为 `value`) | |
|
||||||
| placeholder | 选择框默认文字 | string | - |
|
| placeholder | 选择框默认文字 | string | - | |
|
||||||
| showArrow | 是否显示下拉小箭头 | boolean | true |
|
| showArrow | 是否显示下拉小箭头 | boolean | true | 3.2.1 |
|
||||||
| showSearch | 使单选模式可搜索 | boolean | false |
|
| showSearch | 使单选模式可搜索 | boolean | false | |
|
||||||
| size | 选择框大小,可选 `large` `small` | string | default |
|
| size | 选择框大小,可选 `large` `small` | string | default | |
|
||||||
| suffixIcon | 自定义的选择框后缀图标 | ReactNode | - |
|
| suffixIcon | 自定义的选择框后缀图标 | ReactNode | - | 3.10.0 |
|
||||||
| removeIcon | 自定义的多选框清除图标 | ReactNode | - |
|
| removeIcon | 自定义的多选框清除图标 | ReactNode | - | 3.11.0 |
|
||||||
| clearIcon | 自定义的多选框清空图标 | ReactNode | - |
|
| clearIcon | 自定义的多选框清空图标 | ReactNode | - | 3.11.0 |
|
||||||
| menuItemSelectedIcon | 自定义多选时当前选中的条目图标 | ReactNode | - |
|
| menuItemSelectedIcon | 自定义多选时当前选中的条目图标 | ReactNode | - | 3.11.0 |
|
||||||
| tokenSeparators | 在 tags 和 multiple 模式下自动分词的分隔符 | string\[] | |
|
| tokenSeparators | 在 tags 和 multiple 模式下自动分词的分隔符 | string\[] | | |
|
||||||
| value | 指定当前选中的条目 | string\|string\[]\<br />number\|number\[]\<br />LabeledValue\|LabeledValue[] | - |
|
| value | 指定当前选中的条目 | string\|string\[]\<br />number\|number\[]\<br />LabeledValue\|LabeledValue[] | - | |
|
||||||
| onBlur | 失去焦点时回调 | function | - |
|
| onBlur | 失去焦点时回调 | function | - | |
|
||||||
| onChange | 选中 option,或 input 的 value 变化(combobox 模式下)时,调用此函数 | function(value, option:Option/Array<Option>) | - |
|
| onChange | 选中 option,或 input 的 value 变化(combobox 模式下)时,调用此函数 | function(value, option:Option/Array<Option>) | - | |
|
||||||
| onDeselect | 取消选中时调用,参数为选中项的 value (或 key) 值,仅在 multiple 或 tags 模式下生效 | function(string\|number\|LabeledValue) | - |
|
| onDeselect | 取消选中时调用,参数为选中项的 value (或 key) 值,仅在 multiple 或 tags 模式下生效 | function(string\|number\|LabeledValue) | - | |
|
||||||
| onFocus | 获得焦点时回调 | function | - |
|
| onFocus | 获得焦点时回调 | function | - | |
|
||||||
| onMouseEnter | 鼠标移入时回调 | function | - |
|
| onMouseEnter | 鼠标移入时回调 | function | - | |
|
||||||
| onMouseLeave | 鼠标移出时回调 | function | - |
|
| onMouseLeave | 鼠标移出时回调 | function | - | |
|
||||||
| onPopupScroll | 下拉列表滚动时的回调 | function | - |
|
| onPopupScroll | 下拉列表滚动时的回调 | function | - | |
|
||||||
| onSearch | 文本框值变化时回调 | function(value: string) | |
|
| onSearch | 文本框值变化时回调 | function(value: string) | | |
|
||||||
| onSelect | 被选中时调用,参数为选中项的 value (或 key) 值 | function(string\|number\|LabeledValue, option:Option) | - |
|
| onSelect | 被选中时调用,参数为选中项的 value (或 key) 值 | function(string\|number\|LabeledValue, option:Option) | - | |
|
||||||
| defaultOpen | 是否默认展开下拉菜单 | boolean | - |
|
| defaultOpen | 是否默认展开下拉菜单 | boolean | - | 3.9.3 |
|
||||||
| open | 是否展开下拉菜单 | boolean | - |
|
| open | 是否展开下拉菜单 | boolean | - | 3.9.0 |
|
||||||
| onDropdownVisibleChange | 展开下拉菜单的回调 (3.9.0 后支持) | function(open) | - |
|
| onDropdownVisibleChange | 展开下拉菜单的回调 (3.9.0 后支持) | function(open) | - | 3.9.0 |
|
||||||
| loading | 加载中状态 | Boolean | false |
|
| loading | 加载中状态 | Boolean | false | 3.11.0 |
|
||||||
|
|
||||||
> 注意,如果发现下拉菜单跟随页面滚动,或者需要在其他弹层中触发 Select,请尝试使用 `getPopupContainer={triggerNode => triggerNode.parentElement}` 将下拉弹层渲染节点固定在触发器的父元素中。
|
> 注意,如果发现下拉菜单跟随页面滚动,或者需要在其他弹层中触发 Select,请尝试使用 `getPopupContainer={triggerNode => triggerNode.parentElement}` 将下拉弹层渲染节点固定在触发器的父元素中。
|
||||||
|
|
||||||
### Select Methods
|
### Select Methods
|
||||||
|
|
||||||
| 名称 | 说明 |
|
| 名称 | 说明 | 版本 |
|
||||||
| ------- | -------- |
|
| ------- | -------- | ---- |
|
||||||
| blur() | 取消焦点 |
|
| blur() | 取消焦点 | |
|
||||||
| focus() | 获取焦点 |
|
| focus() | 获取焦点 | |
|
||||||
|
|
||||||
### Option props
|
### Option props
|
||||||
|
|
||||||
| 参数 | 说明 | 类型 | 默认值 |
|
| 参数 | 说明 | 类型 | 默认值 | 版本 |
|
||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- | --- |
|
||||||
| disabled | 是否禁用 | boolean | false |
|
| disabled | 是否禁用 | boolean | false | |
|
||||||
| key | 和 value 含义一致。如果 React 需要你设置此项,此项值与 value 的值相同,然后可以省略 value 设置 | string | |
|
| key | 和 value 含义一致。如果 React 需要你设置此项,此项值与 value 的值相同,然后可以省略 value 设置 | string | | |
|
||||||
| title | 选中该 Option 后,Select 的 title | string | - |
|
| title | 选中该 Option 后,Select 的 title | string | - | |
|
||||||
| value | 默认根据此属性值进行筛选 | string\|number | - |
|
| value | 默认根据此属性值进行筛选 | string\|number | - | |
|
||||||
| className | Option 器类名 | string | - |
|
| className | Option 器类名 | string | - | 3.10.1 |
|
||||||
|
|
||||||
### OptGroup props
|
### OptGroup props
|
||||||
|
|
||||||
| 参数 | 说明 | 类型 | 默认值 |
|
| 参数 | 说明 | 类型 | 默认值 | 版本 |
|
||||||
| ----- | ---- | --------------------- | ------ |
|
| ----- | ---- | --------------------- | ------ | ---- |
|
||||||
| key | | string | - |
|
| key | | string | - | |
|
||||||
| label | 组名 | string\|React.Element | 无 |
|
| label | 组名 | string\|React.Element | 无 | |
|
||||||
|
@ -18,30 +18,30 @@ Provide a placeholder while you wait for content to load, or to visualise conten
|
|||||||
|
|
||||||
### Skeleton
|
### Skeleton
|
||||||
|
|
||||||
| Property | Description | Type | Default |
|
| Property | Description | Type | Default | Version |
|
||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- | --- |
|
||||||
| active | Show animation effect | boolean | false |
|
| active | Show animation effect | boolean | false | 3.9.0 |
|
||||||
| avatar | Show avatar placeholder | boolean \| [SkeletonAvatarProps](#SkeletonAvatarProps) | false |
|
| avatar | Show avatar placeholder | boolean \| [SkeletonAvatarProps](#SkeletonAvatarProps) | false | 3.9.0 |
|
||||||
| loading | Display the skeleton when `true` | boolean | - |
|
| loading | Display the skeleton when `true` | boolean | - | 3.9.0 |
|
||||||
| paragraph | Show paragraph placeholder | boolean \| [SkeletonParagraphProps](#SkeletonParagraphProps) | true |
|
| paragraph | Show paragraph placeholder | boolean \| [SkeletonParagraphProps](#SkeletonParagraphProps) | true | 3.9.0 |
|
||||||
| title | Show title placeholder | boolean \| [SkeletonTitleProps](#SkeletonTitleProps) | true |
|
| title | Show title placeholder | boolean \| [SkeletonTitleProps](#SkeletonTitleProps) | true | 3.9.0 |
|
||||||
|
|
||||||
### SkeletonAvatarProps
|
### SkeletonAvatarProps
|
||||||
|
|
||||||
| Property | Description | Type | Default |
|
| Property | Description | Type | Default | Version |
|
||||||
| -------- | ----------------------- | --------------------------------------------- | ------- |
|
| --- | --- | --- | --- | --- |
|
||||||
| size | Set the size of avatar | number \| Enum{ 'large', 'small', 'default' } | - |
|
| size | Set the size of avatar | number \| Enum{ 'large', 'small', 'default' } | - | 3.9.0 |
|
||||||
| shape | Set the shape of avatar | Enum{ 'circle', 'square' } | - |
|
| shape | Set the shape of avatar | Enum{ 'circle', 'square' } | - | 3.9.0 |
|
||||||
|
|
||||||
### SkeletonTitleProps
|
### SkeletonTitleProps
|
||||||
|
|
||||||
| Property | Description | Type | Default |
|
| Property | Description | Type | Default | Version |
|
||||||
| -------- | ---------------------- | ---------------- | ------- |
|
| -------- | ---------------------- | ---------------- | ------- | ------- |
|
||||||
| width | Set the width of title | number \| string | - |
|
| width | Set the width of title | number \| string | - | 3.9.0 |
|
||||||
|
|
||||||
### SkeletonParagraphProps
|
### SkeletonParagraphProps
|
||||||
|
|
||||||
| Property | Description | Type | Default |
|
| Property | Description | Type | Default | Version |
|
||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- | --- |
|
||||||
| rows | Set the row count of paragraph | number | - |
|
| rows | Set the row count of paragraph | number | - | 3.9.0 |
|
||||||
| width | Set the width of paragraph. When width is an Array, it can set the width of each row. Otherwise only set the last row width | number \| string \| Array<number \| string> | - |
|
| width | Set the width of paragraph. When width is an Array, it can set the width of each row. Otherwise only set the last row width | number \| string \| Array<number \| string> | - | 3.9.0 |
|
||||||
|
@ -19,30 +19,30 @@ cols: 1
|
|||||||
|
|
||||||
### Skeleton
|
### Skeleton
|
||||||
|
|
||||||
| 属性 | 说明 | 类型 | 默认值 |
|
| 属性 | 说明 | 类型 | 默认值 | 版本 |
|
||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- | --- |
|
||||||
| active | 是否展示动画效果 | boolean | false |
|
| active | 是否展示动画效果 | boolean | false | 3.9.0 |
|
||||||
| avatar | 是否显示头像占位图 | boolean \| [SkeletonAvatarProps](#SkeletonAvatarProps) | false |
|
| avatar | 是否显示头像占位图 | boolean \| [SkeletonAvatarProps](#SkeletonAvatarProps) | false | 3.9.0 |
|
||||||
| loading | 为 `true` 时,显示占位图。反之则直接展示子组件 | boolean | - |
|
| loading | 为 `true` 时,显示占位图。反之则直接展示子组件 | boolean | - | 3.9.0 |
|
||||||
| paragraph | 是否显示段落占位图 | boolean \| [SkeletonParagraphProps](#SkeletonParagraphProps) | true |
|
| paragraph | 是否显示段落占位图 | boolean \| [SkeletonParagraphProps](#SkeletonParagraphProps) | true | 3.9.0 |
|
||||||
| title | 是否显示标题占位图 | boolean \| [SkeletonTitleProps](#SkeletonTitleProps) | true |
|
| title | 是否显示标题占位图 | boolean \| [SkeletonTitleProps](#SkeletonTitleProps) | true | 3.9.0 |
|
||||||
|
|
||||||
### SkeletonAvatarProps
|
### SkeletonAvatarProps
|
||||||
|
|
||||||
| 属性 | 说明 | 类型 | 默认值 |
|
| 属性 | 说明 | 类型 | 默认值 | 版本 |
|
||||||
| ----- | -------------------- | --------------------------------------------- | ------ |
|
| ----- | -------------------- | --------------------------------------------- | ------ | ----- |
|
||||||
| size | 设置头像占位图的大小 | number \| Enum{ 'large', 'small', 'default' } | - |
|
| size | 设置头像占位图的大小 | number \| Enum{ 'large', 'small', 'default' } | - | 3.9.0 |
|
||||||
| shape | 指定头像的形状 | Enum{ 'circle', 'square' } | - |
|
| shape | 指定头像的形状 | Enum{ 'circle', 'square' } | - | 3.9.0 |
|
||||||
|
|
||||||
### SkeletonTitleProps
|
### SkeletonTitleProps
|
||||||
|
|
||||||
| 属性 | 说明 | 类型 | 默认值 |
|
| 属性 | 说明 | 类型 | 默认值 | 版本 |
|
||||||
| ----- | -------------------- | ---------------- | ------ |
|
| ----- | -------------------- | ---------------- | ------ | ----- |
|
||||||
| width | 设置标题占位图的宽度 | number \| string | - |
|
| width | 设置标题占位图的宽度 | number \| string | - | 3.9.0 |
|
||||||
|
|
||||||
### SkeletonParagraphProps
|
### SkeletonParagraphProps
|
||||||
|
|
||||||
| 属性 | 说明 | 类型 | 默认值 |
|
| 属性 | 说明 | 类型 | 默认值 | 版本 |
|
||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- | --- |
|
||||||
| rows | 设置段落占位图的行数 | number | - |
|
| rows | 设置段落占位图的行数 | number | - | 3.9.0 |
|
||||||
| width | 设置段落占位图的宽度,若为数组时则为对应的每行宽度,反之则是最后一行的宽度 | number \| string \| Array<number \| string> | - |
|
| width | 设置段落占位图的宽度,若为数组时则为对应的每行宽度,反之则是最后一行的宽度 | number \| string \| Array<number \| string> | - | 3.9.0 |
|
||||||
|
@ -30,12 +30,12 @@ To input a value in a range.
|
|||||||
| onAfterChange | Fire when `onmouseup` is fired. | Function(value) | NOOP | |
|
| onAfterChange | Fire when `onmouseup` is fired. | Function(value) | NOOP | |
|
||||||
| onChange | Callback function that is fired when the user changes the slider's value. | Function(value) | NOOP | |
|
| onChange | Callback function that is fired when the user changes the slider's value. | Function(value) | NOOP | |
|
||||||
| tooltipPlacement | Set Tooltip display position. Ref [`Tooltip`](/components/tooltip/). | string | | 3.19.0 |
|
| tooltipPlacement | Set Tooltip display position. Ref [`Tooltip`](/components/tooltip/). | string | | 3.19.0 |
|
||||||
| tooltipVisible | If true, Tooltip will show always, or it will not show anyway, even if dragging or hovering. | Boolean | | |
|
| tooltipVisible | If true, Tooltip will show always, or it will not show anyway, even if dragging or hovering. | Boolean | | 3.11.0 |
|
||||||
| getTooltipPopupContainer | The DOM container of the Tooltip, the default behavior is to create a div element in body. | Function | () => document.body | 3.19.0 |
|
| getTooltipPopupContainer | The DOM container of the Tooltip, the default behavior is to create a div element in body. | Function | () => document.body | 3.19.0 |
|
||||||
|
|
||||||
## Methods
|
## Methods
|
||||||
|
|
||||||
| Name | Description |
|
| Name | Description | Version |
|
||||||
| ------- | ------------ |
|
| ------- | ------------ | ------- |
|
||||||
| blur() | remove focus |
|
| blur() | remove focus | |
|
||||||
| focus() | get focus |
|
| focus() | get focus | |
|
||||||
|
@ -30,13 +30,13 @@ title: Slider
|
|||||||
| vertical | 值为 `true` 时,Slider 为垂直方向 | Boolean | false | |
|
| vertical | 值为 `true` 时,Slider 为垂直方向 | Boolean | false | |
|
||||||
| onAfterChange | 与 `onmouseup` 触发时机一致,把当前值作为参数传入。 | Function(value) | NOOP | |
|
| onAfterChange | 与 `onmouseup` 触发时机一致,把当前值作为参数传入。 | Function(value) | NOOP | |
|
||||||
| onChange | 当 Slider 的值发生改变时,会触发 onChange 事件,并把改变后的值作为参数传入。 | Function(value) | NOOP | |
|
| onChange | 当 Slider 的值发生改变时,会触发 onChange 事件,并把改变后的值作为参数传入。 | Function(value) | NOOP | |
|
||||||
| tooltipPlacement | 设置 Tooltip 展示位置。参考 [`Tooltip`](/components/tooltip/)。 | string | | | 3.19.0 |
|
| tooltipPlacement | 设置 Tooltip 展示位置。参考 [`Tooltip`](/components/tooltip/)。 | string | | 3.19.0 |
|
||||||
| tooltipVisible | 值为`true`时,Tooltip 将会始终显示;否则始终不显示,哪怕在拖拽及移入时。 | Boolean | | |
|
| tooltipVisible | 值为`true`时,Tooltip 将会始终显示;否则始终不显示,哪怕在拖拽及移入时。 | Boolean | | 3.11.0 |
|
||||||
| getTooltipPopupContainer | Tooltip 渲染父节点,默认渲染到 body 上。 | Function | () => document.body | 3.19.0 |
|
| getTooltipPopupContainer | Tooltip 渲染父节点,默认渲染到 body 上。 | Function | () => document.body | 3.19.0 |
|
||||||
|
|
||||||
## 方法
|
## 方法
|
||||||
|
|
||||||
| 名称 | 描述 |
|
| 名称 | 描述 | 版本 |
|
||||||
| ------- | -------- |
|
| ------- | -------- | ---- |
|
||||||
| blur() | 移除焦点 |
|
| blur() | 移除焦点 | |
|
||||||
| focus() | 获取焦点 |
|
| focus() | 获取焦点 | |
|
||||||
|
@ -12,14 +12,14 @@ When part of the page is waiting for asynchronous data or during a rendering pro
|
|||||||
|
|
||||||
## API
|
## API
|
||||||
|
|
||||||
| Property | Description | Type | Default Value |
|
| Property | Description | Type | Default Value | Version |
|
||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- | --- |
|
||||||
| delay | specifies a delay in milliseconds for loading state (prevent flush) | number (milliseconds) | - |
|
| delay | specifies a delay in milliseconds for loading state (prevent flush) | number (milliseconds) | - | |
|
||||||
| indicator | React node of the spinning indicator | ReactElement | - |
|
| indicator | React node of the spinning indicator | ReactElement | - | |
|
||||||
| size | size of Spin, options: `small`, `default` and `large` | string | `default` |
|
| size | size of Spin, options: `small`, `default` and `large` | string | `default` | |
|
||||||
| spinning | whether Spin is spinning | boolean | true |
|
| spinning | whether Spin is spinning | boolean | true | |
|
||||||
| tip | customize description content when Spin has children | string | - |
|
| tip | customize description content when Spin has children | string | - | |
|
||||||
| wrapperClassName | className of wrapper when Spin has children | string | - |
|
| wrapperClassName | className of wrapper when Spin has children | string | - | |
|
||||||
|
|
||||||
### Static Method
|
### Static Method
|
||||||
|
|
||||||
|
@ -13,14 +13,14 @@ subtitle: 加载中
|
|||||||
|
|
||||||
## API
|
## API
|
||||||
|
|
||||||
| 参数 | 说明 | 类型 | 默认值 |
|
| 参数 | 说明 | 类型 | 默认值 | 版本 |
|
||||||
| ---------------- | -------------------------------------------- | ------------- | --------- |
|
| --- | --- | --- | --- | --- |
|
||||||
| delay | 延迟显示加载效果的时间(防止闪烁) | number (毫秒) | - |
|
| delay | 延迟显示加载效果的时间(防止闪烁) | number (毫秒) | - | |
|
||||||
| indicator | 加载指示符 | ReactElement | - |
|
| indicator | 加载指示符 | ReactElement | - | |
|
||||||
| size | 组件大小,可选值为 `small` `default` `large` | string | 'default' |
|
| size | 组件大小,可选值为 `small` `default` `large` | string | 'default' | |
|
||||||
| spinning | 是否为加载中状态 | boolean | true |
|
| spinning | 是否为加载中状态 | boolean | true | |
|
||||||
| tip | 当作为包裹元素时,可以自定义描述文案 | string | - |
|
| tip | 当作为包裹元素时,可以自定义描述文案 | string | - | |
|
||||||
| wrapperClassName | 包装器的类属性 | string | - |
|
| wrapperClassName | 包装器的类属性 | string | - | |
|
||||||
|
|
||||||
### 静态方法
|
### 静态方法
|
||||||
|
|
||||||
|
@ -15,26 +15,26 @@ Display statistic number.
|
|||||||
|
|
||||||
#### Statistic
|
#### Statistic
|
||||||
|
|
||||||
| Property | Description | Type | Default |
|
| Property | Description | Type | Default | Version |
|
||||||
| ---------------- | ----------------------------- | -------------------- | ------- |
|
| ---------------- | ----------------------------- | -------------------- | ------- | ------- |
|
||||||
| decimalSeparator | decimal separator | string | . |
|
| decimalSeparator | decimal separator | string | . | 3.13.0 |
|
||||||
| formatter | customize value display logic | (value) => ReactNode | - |
|
| formatter | customize value display logic | (value) => ReactNode | - | 3.13.0 |
|
||||||
| groupSeparator | group separator | string | , |
|
| groupSeparator | group separator | string | , | 3.13.0 |
|
||||||
| precision | precision of input value | number | - |
|
| precision | precision of input value | number | - | 3.13.0 |
|
||||||
| prefix | prefix node of value | string \| ReactNode | - |
|
| prefix | prefix node of value | string \| ReactNode | - | 3.13.0 |
|
||||||
| suffix | suffix node of value | string \| ReactNode | - |
|
| suffix | suffix node of value | string \| ReactNode | - | 3.13.0 |
|
||||||
| title | Display title | string \| ReactNode | - |
|
| title | Display title | string \| ReactNode | - | 3.13.0 |
|
||||||
| value | Display value | string \| number | - |
|
| value | Display value | string \| number | - | 3.13.0 |
|
||||||
| valueStyle | Set value css style | style | - |
|
| valueStyle | Set value css style | style | - | 3.13.0 |
|
||||||
|
|
||||||
#### Statistic.Countdown
|
#### Statistic.Countdown
|
||||||
|
|
||||||
| Property | Description | Type | Default |
|
| Property | Description | Type | Default | Version |
|
||||||
| ---------- | ---------------------------------------- | ------------------- | ---------- |
|
| --- | --- | --- | --- | --- |
|
||||||
| format | Format as [moment](http://momentjs.com/) | string | 'HH:mm:ss' |
|
| format | Format as [moment](http://momentjs.com/) | string | 'HH:mm:ss' | 3.13.0 |
|
||||||
| onFinish | Trigger when time's up | () => void | - |
|
| onFinish | Trigger when time's up | () => void | - | 3.14.0 |
|
||||||
| prefix | prefix node of value | string \| ReactNode | - |
|
| prefix | prefix node of value | string \| ReactNode | - | 3.13.0 |
|
||||||
| suffix | suffix node of value | string \| ReactNode | - |
|
| suffix | suffix node of value | string \| ReactNode | - | 3.13.0 |
|
||||||
| title | Display title | string \| ReactNode | - |
|
| title | Display title | string \| ReactNode | - | 3.13.0 |
|
||||||
| value | Set target countdown time | number \| moment | - |
|
| value | Set target countdown time | number \| moment | - | 3.13.0 |
|
||||||
| valueStyle | Set value css style | style | - |
|
| valueStyle | Set value css style | style | - | 3.13.0 |
|
||||||
|
@ -16,26 +16,26 @@ title: Statistic
|
|||||||
|
|
||||||
#### Statistic
|
#### Statistic
|
||||||
|
|
||||||
| 参数 | 说明 | 类型 | 默认值 |
|
| 参数 | 说明 | 类型 | 默认值 | 版本 |
|
||||||
| ---------------- | ---------------- | -------------------- | ------ |
|
| ---------------- | ---------------- | -------------------- | ------ | ------ |
|
||||||
| decimalSeparator | 设置小数点 | string | . |
|
| decimalSeparator | 设置小数点 | string | . | 3.13.0 |
|
||||||
| formatter | 自定义数值展示 | (value) => ReactNode | - |
|
| formatter | 自定义数值展示 | (value) => ReactNode | - | 3.13.0 |
|
||||||
| groupSeparator | 设置千分位标识符 | string | , |
|
| groupSeparator | 设置千分位标识符 | string | , | 3.13.0 |
|
||||||
| precision | 数值精度 | number | - |
|
| precision | 数值精度 | number | - | 3.13.0 |
|
||||||
| prefix | 设置数值的前缀 | string \| ReactNode | - |
|
| prefix | 设置数值的前缀 | string \| ReactNode | - | 3.13.0 |
|
||||||
| suffix | 设置数值的后缀 | string \| ReactNode | - |
|
| suffix | 设置数值的后缀 | string \| ReactNode | - | 3.13.0 |
|
||||||
| title | 数值的标题 | string \| ReactNode | - |
|
| title | 数值的标题 | string \| ReactNode | - | 3.13.0 |
|
||||||
| value | 数值内容 | string \| number | - |
|
| value | 数值内容 | string \| number | - | 3.13.0 |
|
||||||
| valueStyle | 设置数值的样式 | style | - |
|
| valueStyle | 设置数值的样式 | style | - | 3.13.0 |
|
||||||
|
|
||||||
#### Statistic.Countdown
|
#### Statistic.Countdown
|
||||||
|
|
||||||
| 参数 | 说明 | 类型 | 默认值 |
|
| 参数 | 说明 | 类型 | 默认值 | 版本 |
|
||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- | --- |
|
||||||
| format | 格式化倒计时展示,参考 [moment](http://momentjs.com/) | string | 'HH:mm:ss' |
|
| format | 格式化倒计时展示,参考 [moment](http://momentjs.com/) | string | 'HH:mm:ss' | 3.13.0 |
|
||||||
| onFinish | 倒计时完成时触发 | () => void | - |
|
| onFinish | 倒计时完成时触发 | () => void | - | 3.14.0 |
|
||||||
| prefix | 设置数值的前缀 | string \| ReactNode | - |
|
| prefix | 设置数值的前缀 | string \| ReactNode | - | 3.13.0 |
|
||||||
| suffix | 设置数值的后缀 | string \| ReactNode | - |
|
| suffix | 设置数值的后缀 | string \| ReactNode | - | 3.13.0 |
|
||||||
| title | 数值的标题 | string \| ReactNode | - |
|
| title | 数值的标题 | string \| ReactNode | - | 3.13.0 |
|
||||||
| value | 数值内容 | number \| moment | - |
|
| value | 数值内容 | number \| moment | - | 3.13.0 |
|
||||||
| valueStyle | 设置数值的样式 | style | - |
|
| valueStyle | 设置数值的样式 | style | - | 3.13.0 |
|
||||||
|
@ -27,23 +27,23 @@ The whole of the step bar.
|
|||||||
|
|
||||||
| Property | Description | Type | Default | Version |
|
| Property | Description | Type | Default | Version |
|
||||||
| --- | --- | --- | --- | --- |
|
| --- | --- | --- | --- | --- |
|
||||||
| className | additional class to Steps | string | - | |
|
| className | additional class to Steps | string | - | 3.11.3 |
|
||||||
| current | to set the current step, counting from 0. You can overwrite this state by using `status` of `Step` | number | 0 | |
|
| current | to set the current step, counting from 0. You can overwrite this state by using `status` of `Step` | number | 0 | |
|
||||||
| direction | to specify the direction of the step bar, `horizontal` or `vertical` | string | `horizontal` | |
|
| direction | to specify the direction of the step bar, `horizontal` or `vertical` | string | `horizontal` | |
|
||||||
| labelPlacement | place title and description with `horizontal` or `vertical` direction | string | `horizontal` | |
|
| labelPlacement | place title and description with `horizontal` or `vertical` direction | string | `horizontal` | 3.7.3 |
|
||||||
| progressDot | Steps with progress dot style, customize the progress dot by setting it to a function. labelPlacement will be `vertical` | Boolean or (iconDot, {index, status, title, description}) => ReactNode | false | |
|
| progressDot | Steps with progress dot style, customize the progress dot by setting it to a function. labelPlacement will be `vertical` | Boolean or (iconDot, {index, status, title, description}) => ReactNode | false | |
|
||||||
| size | to specify the size of the step bar, `default` and `small` are currently supported | string | `default` | |
|
| size | to specify the size of the step bar, `default` and `small` are currently supported | string | `default` | |
|
||||||
| status | to specify the status of current step, can be set to one of the following values: `wait` `process` `finish` `error` | string | `process` | |
|
| status | to specify the status of current step, can be set to one of the following values: `wait` `process` `finish` `error` | string | `process` | |
|
||||||
| initial | set the initial step, counting from 0 | number | 0 | |
|
| initial | set the initial step, counting from 0 | number | 0 | 3.9.0 |
|
||||||
| onChange | Trigger when Step click to change | (current) => void | - | 3.19.0 |
|
| onChange | Trigger when Step click to change | (current) => void | - | 3.19.0 |
|
||||||
|
|
||||||
### Steps.Step
|
### Steps.Step
|
||||||
|
|
||||||
A single step in the step bar.
|
A single step in the step bar.
|
||||||
|
|
||||||
| Property | Description | Type | Default |
|
| Property | Description | Type | Default | Version |
|
||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- | --- |
|
||||||
| description | description of the step, optional property | string\|ReactNode | - |
|
| description | description of the step, optional property | string\|ReactNode | - | |
|
||||||
| icon | icon of the step, optional property | string\|ReactNode | - |
|
| icon | icon of the step, optional property | string\|ReactNode | - | |
|
||||||
| status | to specify the status. It will be automatically set by `current` of `Steps` if not configured. Optional values are: `wait` `process` `finish` `error` | string | `wait` |
|
| status | to specify the status. It will be automatically set by `current` of `Steps` if not configured. Optional values are: `wait` `process` `finish` `error` | string | `wait` | |
|
||||||
| title | title of the step | string\|ReactNode | - |
|
| title | title of the step | string\|ReactNode | - | |
|
||||||
|
@ -28,23 +28,23 @@ title: Steps
|
|||||||
|
|
||||||
| 参数 | 说明 | 类型 | 默认值 | 版本 |
|
| 参数 | 说明 | 类型 | 默认值 | 版本 |
|
||||||
| --- | --- | --- | --- | --- |
|
| --- | --- | --- | --- | --- |
|
||||||
| className | 步骤条类名 | string | - | |
|
| className | 步骤条类名 | string | - | 3.11.3 |
|
||||||
| current | 指定当前步骤,从 0 开始记数。在子 Step 元素中,可以通过 `status` 属性覆盖状态 | number | 0 | |
|
| current | 指定当前步骤,从 0 开始记数。在子 Step 元素中,可以通过 `status` 属性覆盖状态 | number | 0 | |
|
||||||
| direction | 指定步骤条方向。目前支持水平(`horizontal`)和竖直(`vertical`)两种方向 | string | horizontal | |
|
| direction | 指定步骤条方向。目前支持水平(`horizontal`)和竖直(`vertical`)两种方向 | string | horizontal | |
|
||||||
| labelPlacement | 指定标签放置位置,默认水平放图标右侧,可选 `vertical` 放图标下方 | string | `horizontal` | |
|
| labelPlacement | 指定标签放置位置,默认水平放图标右侧,可选 `vertical` 放图标下方 | string | `horizontal` | 3.7.3 |
|
||||||
| progressDot | 点状步骤条,可以设置为一个 function,labelPlacement 将强制为 `vertical` | Boolean or (iconDot, {index, status, title, description}) => ReactNode | false | |
|
| progressDot | 点状步骤条,可以设置为一个 function,labelPlacement 将强制为 `vertical` | Boolean or (iconDot, {index, status, title, description}) => ReactNode | false | |
|
||||||
| size | 指定大小,目前支持普通(`default`)和迷你(`small`) | string | default | |
|
| size | 指定大小,目前支持普通(`default`)和迷你(`small`) | string | default | |
|
||||||
| status | 指定当前步骤的状态,可选 `wait` `process` `finish` `error` | string | process | |
|
| status | 指定当前步骤的状态,可选 `wait` `process` `finish` `error` | string | process | |
|
||||||
| initial | 起始序号,从 0 开始记数 | number | 0 | |
|
| initial | 起始序号,从 0 开始记数 | number | 0 | 3.9.0 |
|
||||||
| onChange | 点击切换步骤时触发 | (current) => void | - | 3.19.0 |
|
| onChange | 点击切换步骤时触发 | (current) => void | - | 3.19.0 |
|
||||||
|
|
||||||
### Steps.Step
|
### Steps.Step
|
||||||
|
|
||||||
步骤条内的每一个步骤。
|
步骤条内的每一个步骤。
|
||||||
|
|
||||||
| 参数 | 说明 | 类型 | 默认值 |
|
| 参数 | 说明 | 类型 | 默认值 | 版本 |
|
||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- | --- |
|
||||||
| description | 步骤的详情描述,可选 | string\|ReactNode | - |
|
| description | 步骤的详情描述,可选 | string\|ReactNode | - | |
|
||||||
| icon | 步骤图标的类型,可选 | string\|ReactNode | - |
|
| icon | 步骤图标的类型,可选 | string\|ReactNode | - | |
|
||||||
| status | 指定状态。当不配置该属性时,会使用 Steps 的 `current` 来自动指定状态。可选:`wait` `process` `finish` `error` | string | wait |
|
| status | 指定状态。当不配置该属性时,会使用 Steps 的 `current` 来自动指定状态。可选:`wait` `process` `finish` `error` | string | wait | |
|
||||||
| title | 标题 | string\|ReactNode | - |
|
| title | 标题 | string\|ReactNode | - | |
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user