mirror of
https://github.com/ant-design/ant-design.git
synced 2025-01-18 22:36:31 +08:00
docs: Unify type naming (#4636)
* Unify name of ReactNode type in document * Lowser all string type name * Lowercase all number type name * Lowercase all boolean type name * Unify array type * Lowercase all object type name * Unify mutilple types
This commit is contained in:
parent
d2c00fae4b
commit
77b78a9389
@ -16,8 +16,8 @@ Please note that Affix should not cover other content on the page, especially wh
|
||||
|
||||
| Property | Description | Type | Default |
|
||||
|--------------|-----------------------|----------|--------------|
|
||||
| offsetTop | Pixels to offset from top when calculating position of scroll | Number | 0 |
|
||||
| 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 |
|
||||
| offsetBottom | Pixels to offset from bottom when calculating position of scroll | number | - |
|
||||
| onChange | Callback when affix state is changed | Function(affixed) | - |
|
||||
|
||||
**Note:** Children of `Affix` can not be `position: absolute`, but you can set `Affix` as `position: absolute`:
|
||||
|
@ -17,8 +17,8 @@ title: Affix
|
||||
|
||||
| 成员 | 说明 | 类型 | 默认值 |
|
||||
|-------------|----------------|--------------------|--------------|
|
||||
| offsetTop | 距离窗口顶部达到指定偏移量后触发 | Number | |
|
||||
| offsetBottom | 距离窗口底部达到指定偏移量后触发 | Number | |
|
||||
| offsetTop | 距离窗口顶部达到指定偏移量后触发 | number | |
|
||||
| offsetBottom | 距离窗口底部达到指定偏移量后触发 | number | |
|
||||
| target | 设置 `Affix` 需要监听其滚动事件的元素,值为一个返回对应 DOM 元素的函数 | Function | () => window |
|
||||
| onChange | 固定状态改变时触发的回调函数 | Function(affixed) | 无 |
|
||||
|
||||
|
@ -15,11 +15,11 @@ Alert component for feedback.
|
||||
|
||||
| Property | Description | Type | Default |
|
||||
|----------- |--------------------------------------------------------- | ---------- |-------|
|
||||
| type | Type of Alert styles, options:`success`, `info`, `warning`, `error` | String | `info` |
|
||||
| closable | Whether Alert can be closed | Boolean | - |
|
||||
| closeText | Close text to show | React.Node | - |
|
||||
| message | Content of Alert | React.Node | - |
|
||||
| description | Additional content of Alert | React.Node | - |
|
||||
| type | Type of Alert styles, options:`success`, `info`, `warning`, `error` | string | `info` |
|
||||
| closable | Whether Alert can be closed | boolean | - |
|
||||
| closeText | Close text to show | string\|ReactNode | - |
|
||||
| message | Content of Alert | string\|ReactNode | - |
|
||||
| description | Additional content of Alert | string\|ReactNode | - |
|
||||
| onClose | Callback when close Alert | Function | - |
|
||||
| showIcon | Whether to show icon | Boolean | false |
|
||||
| banner | Whether to show as banner | Boolean | false |
|
||||
| showIcon | Whether to show icon | boolean | false |
|
||||
| banner | Whether to show as banner | boolean | false |
|
||||
|
@ -16,12 +16,12 @@ title: Alert
|
||||
|
||||
| 参数 | 说明 | 类型 | 默认值 |
|
||||
|----------- |--------------------------------------------------------- | ---------- |-------|
|
||||
| type | 指定警告提示的样式,有四种选择 `success`、`info`、`warning`、`error` | String | `info` |
|
||||
| closable | 默认不显示关闭按钮 | Boolean | 无 |
|
||||
| closeText | 自定义关闭按钮 | React.Node | 无 |
|
||||
| message | 警告提示内容 | React.Node | 无 |
|
||||
| description | 警告提示的辅助性文字介绍 | React.Node | 无 |
|
||||
| type | 指定警告提示的样式,有四种选择 `success`、`info`、`warning`、`error` | string | `info` |
|
||||
| closable | 默认不显示关闭按钮 | boolean | 无 |
|
||||
| closeText | 自定义关闭按钮 | string\|ReactNode | 无 |
|
||||
| message | 警告提示内容 | string\|ReactNode | 无 |
|
||||
| description | 警告提示的辅助性文字介绍 | string\|ReactNode | 无 |
|
||||
| onClose | 关闭时触发的回调函数 | Function | 无 |
|
||||
| showIcon | 是否显示辅助图标 | Boolean | false |
|
||||
| banner | 是否用作顶部公告 | Boolean | false |
|
||||
| showIcon | 是否显示辅助图标 | boolean | false |
|
||||
| banner | 是否用作顶部公告 | boolean | false |
|
||||
|
||||
|
@ -8,7 +8,7 @@ export interface AnchorLinkProps {
|
||||
active?: boolean;
|
||||
prefixCls?: string;
|
||||
children?: any;
|
||||
title?: Element;
|
||||
title?: React.ReactNode;
|
||||
bounds: number;
|
||||
target?: () => HTMLElement | Window;
|
||||
affix?: boolean;
|
||||
|
@ -17,13 +17,13 @@ For displaying anchor hyperlinks on page and jumping between them.
|
||||
|
||||
| Property | Description | Type | Default |
|
||||
|--------------|-----------------------|----------|--------------|
|
||||
| offsetTop | Pixels to offset from top when calculating position of scroll | Number | 0 |
|
||||
| offsetBottom | Pixels to offset from bottom when calculating position of scroll | Number | - |
|
||||
| bounds | Bounding distance of anchor area | Number | 5(px) |
|
||||
| offsetTop | Pixels to offset from top when calculating position of scroll | number | 0 |
|
||||
| offsetBottom | Pixels to offset from bottom when calculating position of scroll | number | - |
|
||||
| bounds | Bounding distance of anchor area | number | 5(px) |
|
||||
|
||||
### Link Props
|
||||
|
||||
| Property | Description | Type | Default |
|
||||
|-------------|----------------|--------------------|--------------|
|
||||
| href | target of hyperlink | String | |
|
||||
| title | content of hyperlink | React.Node | |
|
||||
| href | target of hyperlink | string | |
|
||||
| title | content of hyperlink | string\|ReactNode | |
|
||||
|
@ -18,13 +18,13 @@ title: Anchor
|
||||
|
||||
| 成员 | 说明 | 类型 | 默认值 |
|
||||
|-------------|----------------|--------------------|--------------|
|
||||
| offsetTop | 距离窗口顶部达到指定偏移量后触发 | Number | |
|
||||
| offsetBottom | 距离窗口底部达到指定偏移量后触发 | Number | |
|
||||
| bounds | 锚点区域边界 | Number | 5(px) |
|
||||
| offsetTop | 距离窗口顶部达到指定偏移量后触发 | number | |
|
||||
| offsetBottom | 距离窗口底部达到指定偏移量后触发 | number | |
|
||||
| bounds | 锚点区域边界 | number | 5(px) |
|
||||
|
||||
### Link Props
|
||||
|
||||
| 成员 | 说明 | 类型 | 默认值 |
|
||||
|-------------|----------------|--------------------|--------------|
|
||||
| href | 锚点链接 | String | |
|
||||
| title | 文字内容 | React.Node | |
|
||||
| href | 锚点链接 | string | |
|
||||
| title | 文字内容 | string\|ReactNode | |
|
||||
|
@ -21,9 +21,9 @@ Since `AutoComplete` is based on `Select`, so besides the following API, `AutoCo
|
||||
|
||||
| Property | Description | Type | Default |
|
||||
|----------------|----------------------------------|------------|--------|
|
||||
| dataSource | Data source for autocomplete | Array | |
|
||||
| value | selected option | String/Array<String>/{key: String, label: React.Node}/Array<{key, label}> | - |
|
||||
| defaultValue | Initial selected option. | string/Array<String> | - |
|
||||
| dataSource | Data source for autocomplete | [DataSourceItemType](https://git.io/vMMKF)[] | |
|
||||
| value | selected option | string\|string[]\|{ key: string, label: string\|ReactNode }\|Array<{ key: string, label: string\|ReactNode }> | - |
|
||||
| defaultValue | Initial selected option. | string\|string[]\|{ key: string, label: string\|ReactNode }\|Array<{ key: string, label: string\|ReactNode }> | - |
|
||||
| allowClear | Show clear button, effective in multiple mode only. | boolean | false |
|
||||
| onChange | Called when select an option or input value change, or value of input is changed | function(value, label) | - |
|
||||
| onSelect | Called when a option is selected. param is option's value and option instance. | function(value, option) | - |
|
||||
|
@ -22,9 +22,9 @@ const dataSource = ['12345', '23456', '34567'];
|
||||
|
||||
| 参数 | 说明 | 类型 | 默认值 |
|
||||
|----------------|----------------------------------|------------|---------|
|
||||
| dataSource | 自动完成的数据源 | Array | |
|
||||
| value | 指定当前选中的条目 | String/Array<String>/{key: String, label: React.Node}/Array<{key, label}> | 无 |
|
||||
| defaultValue | 指定默认选中的条目 | String/Array<String>/{key: String, label: React.Node}/Array<{key, label}> | 无 |
|
||||
| dataSource | 自动完成的数据源 | [DataSourceItemType](https://git.io/vMMKF)[] | |
|
||||
| value | 指定当前选中的条目 | string\|string[]\|{ key: string, label: string\|ReactNode }\|Array<{ key: string, label: string\|ReactNode }> | 无 |
|
||||
| defaultValue | 指定默认选中的条目 | string\|string[]\|{ key: string, label: string\|ReactNode }\|Array<{ key: string, label: string\|ReactNode}> | 无 |
|
||||
| allowClear | 支持清除, 单选模式有效 | boolean | false |
|
||||
| onChange | 选中 option,或 input 的 value 变化时,调用此函数 | function(value) | 无 |
|
||||
| onSelect | 被选中时调用,参数为选中项的 value 值 | function(value, option) | 无 |
|
||||
|
@ -20,6 +20,6 @@ title: BackTop
|
||||
|
||||
Property | Description | Type | Default
|
||||
-----|-----|-----|------
|
||||
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 | -
|
||||
|
||||
|
@ -20,5 +20,5 @@ title: BackTop
|
||||
|
||||
| 参数 | 说明 | 类型 | 默认值 |
|
||||
|-------------|----------------|--------------------|--------------|
|
||||
| visibilityHeight | 滚动高度达到此参数值才出现 `BackTop` | Number | 400 |
|
||||
| visibilityHeight | 滚动高度达到此参数值才出现 `BackTop` | number | 400 |
|
||||
| onClick | 点击按钮的回调函数 | Function | - |
|
||||
|
@ -25,8 +25,8 @@ Badge normally appears in proximity to notification or head picture with eye-cat
|
||||
|
||||
| Property | Description | Type | Default |
|
||||
|----------------|-------------------------|------------|---------|
|
||||
| count | Number to show in badge | Number | |
|
||||
| overflowCount | Max count to show | Number | 99 |
|
||||
| dot | Whether to show red dot without number | Boolean | false |
|
||||
| count | Number to show in badge | number | |
|
||||
| overflowCount | Max count to show | number | 99 |
|
||||
| dot | Whether to show red dot without number | boolean | false |
|
||||
| status | Set Badge as a status dot | Enum{ 'success', 'processing, 'default', 'error', 'warning' } | '' |
|
||||
| text | If `status` is set, `text` is to set the text of status dot | String | '' |
|
||||
| text | If `status` is set, `text` is to set the text of status dot | string | '' |
|
||||
|
@ -26,8 +26,8 @@ title: Badge
|
||||
|
||||
| 参数 | 说明 | 类型 | 可选值 | 默认值 |
|
||||
|----------------|----------------------------------|------------|---------|--------|
|
||||
| count | 展示的数字,大于 overflowCount 时显示为 `${overflowCount}+`,为 0 时隐藏 | Number | | |
|
||||
| overflowCount | 展示封顶的数字值 | Number | | 99 |
|
||||
| dot | 不展示数字,只有一个小红点 | Boolean | | false |
|
||||
| count | 展示的数字,大于 overflowCount 时显示为 `${overflowCount}+`,为 0 时隐藏 | number | | |
|
||||
| overflowCount | 展示封顶的数字值 | number | | 99 |
|
||||
| dot | 不展示数字,只有一个小红点 | boolean | | false |
|
||||
| status | 设置 Badge 为状态点 | Enum | 'success'、'processing'、'default'、'error'、'warning' | '' |
|
||||
| text | 在设置了 `status` 的前提下有效,设置状态点的文本 | String | | '' |
|
||||
| text | 在设置了 `status` 的前提下有效,设置状态点的文本 | string | | '' |
|
||||
|
@ -8,7 +8,7 @@ export interface BreadcrumbProps {
|
||||
prefixCls?: string;
|
||||
routes?: Array<any>;
|
||||
params?: Object;
|
||||
separator?: string | React.ReactNode;
|
||||
separator?: React.ReactNode;
|
||||
itemRender?: (route: any, params: any, routes: Array<any>, paths: Array<string>) => React.ReactNode;
|
||||
style?: React.CSSProperties;
|
||||
className?: string;
|
||||
@ -44,10 +44,7 @@ export default class Breadcrumb extends React.Component<BreadcrumbProps, any> {
|
||||
|
||||
static propTypes = {
|
||||
prefixCls: React.PropTypes.string,
|
||||
separator: React.PropTypes.oneOfType([
|
||||
React.PropTypes.string,
|
||||
React.PropTypes.element,
|
||||
]),
|
||||
separator: React.PropTypes.node,
|
||||
routes: React.PropTypes.array,
|
||||
params: React.PropTypes.object,
|
||||
linkRender: React.PropTypes.func,
|
||||
|
@ -17,10 +17,10 @@ A breadcrumb displays the current location within a hierarchy. It allows going b
|
||||
|
||||
| Property | Description | Type | Optional | Default |
|
||||
|-----------|-----------------------------------|-----------------|---------|--------|
|
||||
| routes | The routing stack information of router | Array | | - |
|
||||
| params | Routing parameter | Object | | - |
|
||||
| separator | Custom separator | String or Element | | '/' |
|
||||
| itemRender | Custom item renderer | (route, params, routes, paths) => React.ReactNode | | - |
|
||||
| routes | The routing stack information of router | object[] | | - |
|
||||
| params | Routing parameter | object | | - |
|
||||
| separator | Custom separator | string\|ReactNode | | '/' |
|
||||
| itemRender | Custom item renderer | (route, params, routes, paths) => ReactNode | | - |
|
||||
|
||||
> `linkRender` and `nameRender` were removed after `antd@2.0`, please use `itemRender` instead.
|
||||
|
||||
|
@ -17,10 +17,10 @@ title: Breadcrumb
|
||||
|
||||
| 参数 | 说明 | 类型 | 可选值 | 默认值 |
|
||||
|-----------|-----------------------------------|-----------------|---------|--------|
|
||||
| routes | router 的路由栈信息 | Array | | - |
|
||||
| params | 路由的参数 | Object | | - |
|
||||
| separator | 分隔符自定义 | String or Element | | '/' |
|
||||
| itemRender | 自定义链接函数,和 react-router 配置使用 | (route, params, routes, paths) => React.ReactNode | | - |
|
||||
| routes | router 的路由栈信息 | object[] | | - |
|
||||
| params | 路由的参数 | object | | - |
|
||||
| separator | 分隔符自定义 | string\|ReactNode | | '/' |
|
||||
| itemRender | 自定义链接函数,和 react-router 配置使用 | (route, params, routes, paths) => ReactNode | | - |
|
||||
|
||||
> 2.0 之后,`linkRender` 和 `nameRender` 被移除,请使用 `itemRender` 来代替。
|
||||
|
||||
|
@ -29,5 +29,5 @@ When data is in the form of date, such as schedule, timetable, prices calendar,
|
||||
| fullscreen | to set whether full-screen display | boolean | true |
|
||||
| dateCellRender | to set the way of renderer the date cell | function(date: moment): ReactNode | - |
|
||||
| monthCellRender | to set the way of renderer the month cell | function(date: moment): ReactNode | - |
|
||||
| locale | set locale | Object | [default](https://github.com/ant-design/ant-design/blob/master/components/date-picker/locale/example.json) |
|
||||
| locale | set locale | object | [default](https://github.com/ant-design/ant-design/blob/master/components/date-picker/locale/example.json) |
|
||||
| onPanelChange| the callback when panel change | function(date: moment, mode: string) | - |
|
||||
|
@ -31,5 +31,5 @@ title: Calendar
|
||||
| fullscreen | 是否全屏显示 | boolean | true |
|
||||
| dateCellRender | 自定义渲染日期单元格| function(date: moment): ReactNode | 无 |
|
||||
| monthCellRender | 自定义渲染月单元格 | function(date: moment): ReactNode | 无 |
|
||||
| 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) |
|
||||
| onPanelChange| 日期面板变化回调 | function(date: moment, mode: string) | 无 |
|
||||
|
@ -19,7 +19,7 @@ A card can be used to display content related to a single subject. The content c
|
||||
|
||||
| Property | Description | Type | Default |
|
||||
|----------|----------------|----------|--------------|
|
||||
| title | Card title | React.Element | - |
|
||||
| extra | Content to render in the top-right corner of the card | React.Element | - |
|
||||
| bordered | Toggles rendering of the border around the card | Boolean | true |
|
||||
| bodyStyle | Inline style to apply to the card content | Object | - |
|
||||
| title | Card title | string\|ReactNode | - |
|
||||
| extra | Content to render in the top-right corner of the card | string\|ReactNode | - |
|
||||
| bordered | Toggles rendering of the border around the card | boolean | true |
|
||||
| bodyStyle | Inline style to apply to the card content | object | - |
|
||||
|
@ -20,7 +20,7 @@ cols: 1
|
||||
|
||||
| 参数 | 说明 | 类型 | 默认值 |
|
||||
|----------|----------------|----------|--------------|
|
||||
| title | 卡片标题 | React.Element | - |
|
||||
| extra | 卡片右上角的操作区域 | React.Element | - |
|
||||
| bordered | 是否有边框 | Boolean | true |
|
||||
| bodyStyle | 内容区域自定义样式 | Object | - |
|
||||
| title | 卡片标题 | string\|ReactNode | - |
|
||||
| extra | 卡片右上角的操作区域 | string\|ReactNode | - |
|
||||
| bordered | 是否有边框 | boolean | true |
|
||||
| bodyStyle | 内容区域自定义样式 | object | - |
|
||||
|
@ -16,11 +16,11 @@ A carousel component. Scales with its container.
|
||||
|
||||
| Property | Description | Type | Default |
|
||||
|------------------|----------------------------------------------|----------|---------------------------------|
|
||||
| effect | Animation effect, either `scrollx` or `fade` | String | scrollx |
|
||||
| dots | Whether to show the dots at the bottom of the gallery | Boolean | true |
|
||||
| vertical | Whether to use a vertical display | Boolean | false |
|
||||
| autoplay | Whether to scroll automatically | Boolean | false |
|
||||
| easing | Transition name | String | linear |
|
||||
| effect | Animation effect, either `scrollx` or `fade` | string | scrollx |
|
||||
| dots | Whether to show the dots at the bottom of the gallery | boolean | true |
|
||||
| vertical | Whether to use a vertical display | boolean | false |
|
||||
| autoplay | Whether to scroll automatically | boolean | false |
|
||||
| easing | Transition name | string | linear |
|
||||
| beforeChange | Callback function called before the current index changes | function(from, to) |
|
||||
| afterChange | Callback function called after the current index changes | function(current) |
|
||||
|
||||
|
@ -17,11 +17,11 @@ subtitle: 走马灯
|
||||
|
||||
| 参数 | 说明 | 类型 | 默认值 |
|
||||
|------------------|----------------------------------------------|----------|---------------------------------|
|
||||
| effect | 动画效果函数,可取 scrollx, fade | String | scrollx |
|
||||
| dots | 是否显示面板指示点 | Boolean | true |
|
||||
| vertical | 垂直显示 | Boolean | false |
|
||||
| autoplay | 是否自动切换 | Boolean | false |
|
||||
| easing | 动画效果 | String | linear |
|
||||
| effect | 动画效果函数,可取 scrollx, fade | string | scrollx |
|
||||
| dots | 是否显示面板指示点 | boolean | true |
|
||||
| vertical | 垂直显示 | boolean | false |
|
||||
| autoplay | 是否自动切换 | boolean | false |
|
||||
| easing | 动画效果 | string | linear |
|
||||
| beforeChange | 切换面板的回调 | function(from, to) | 无
|
||||
| afterChange | 切换面板的回调 | function(current) | 无
|
||||
|
||||
|
@ -22,10 +22,10 @@ Cascade selection box.
|
||||
| Property | Description | Type | Default |
|
||||
|------|------|------|--------|
|
||||
| options | data options of cascade | object | - |
|
||||
| defaultValue | initial selected value | array |[] |
|
||||
| value | selected value | array | - |
|
||||
| defaultValue | initial selected value | [CascaderOptionType](https://git.io/vMMoK)[] |[] |
|
||||
| value | selected value | [CascaderOptionType](https://git.io/vMMoK)[] | - |
|
||||
| onChange | callback when finishing cascader select | `(value, selectedOptions) => void` | - |
|
||||
| displayRender | render function of displaying selected options | `(label, selectedOptions) => React.ReactNode` | `label => label.join(' / ')` |
|
||||
| displayRender | render function of displaying selected options | `(label, selectedOptions) => ReactNode` | `label => label.join(' / ')` |
|
||||
| style | additional style | string | - |
|
||||
| className | additional css class | string | - |
|
||||
| popupClassName | additional className of popup overlay | string | - |
|
||||
@ -36,8 +36,8 @@ Cascade selection box.
|
||||
| allowClear | whether allow clear | boolean | true |
|
||||
| expandTrigger | expand current item when click or hover, one of 'click' 'hover' | string | 'click' |
|
||||
| changeOnSelect | change value on each selection if set to true, see above demo for details | boolean | false |
|
||||
| showSearch | Whether show search input in single mode. | Boolean or Object | false |
|
||||
| notFoundContent | Specify content to show when no result matches. | String | 'Not Found' |
|
||||
| showSearch | Whether show search input in single mode. | boolean\|object | false |
|
||||
| notFoundContent | Specify content to show when no result matches. | string | 'Not Found' |
|
||||
| loadData | To load option lazily, and it cannot work with `showSearch` | `(selectedOptions) => void` | - |
|
||||
| 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](http://codepen.io/anon/pen/xVBOVQ?editors=001) | Function(triggerNode) | () => document.body |
|
||||
|
||||
@ -46,7 +46,7 @@ Fields in `showSearch`:
|
||||
| Property | Description | Type | Default |
|
||||
|----------|-------------|------|---------|
|
||||
| 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` | |
|
||||
| render | Used to render filtered options. | `function(inputValue, path): React.ReactNode` | |
|
||||
| render | Used to render filtered options. | `function(inputValue, path): ReactNode` | |
|
||||
| sort | Used to sort filtered options. | `function(a, b, inputValue)` | |
|
||||
| matchInputWidth | Whether the width of result list equals to input's | boolean | |
|
||||
|
||||
|
@ -22,23 +22,23 @@ subtitle: 级联选择
|
||||
|
||||
| 参数 | 说明 | 类型 | 默认值 |
|
||||
|------|------|------|--------|
|
||||
| options | 可选项数据源 | Object | - |
|
||||
| defaultValue | 默认的选中项 | Array |[] |
|
||||
| value | 指定选中项 | Array | - |
|
||||
| options | 可选项数据源 | object | - |
|
||||
| defaultValue | 默认的选中项 | [CascaderOptionType](https://git.io/vMMoK)[] |[] |
|
||||
| value | 指定选中项 | [CascaderOptionType](https://git.io/vMMoK)[] | - |
|
||||
| onChange | 选择完成后的回调 | `(value, selectedOptions) => void` | - |
|
||||
| displayRender | 选择后展示的渲染函数 | `(label, selectedOptions) => React.ReactNode` | `label => label.join(' / ')` |
|
||||
| style | 自定义样式 | String | - |
|
||||
| className | 自定义类名 | String | - |
|
||||
| popupClassName | 自定义浮层类名 | String | - |
|
||||
| displayRender | 选择后展示的渲染函数 | `(label, selectedOptions) => ReactNode` | `label => label.join(' / ')` |
|
||||
| style | 自定义样式 | string | - |
|
||||
| className | 自定义类名 | string | - |
|
||||
| popupClassName | 自定义浮层类名 | string | - |
|
||||
| popupPlacement | 浮层预设位置:`bottomLeft` `bottomRight` `topLeft` `topRight` | Enum | `bottomLeft` |
|
||||
| placeholder | 输入框占位文本 | String | '请选择' |
|
||||
| size | 输入框大小,可选 `large` `default` `small` | String | `default` |
|
||||
| disabled | 禁用 | Boolean | false |
|
||||
| allowClear | 是否支持清除 | Boolean | true |
|
||||
| expandTrigger | 次级菜单的展开方式,可选 'click' 和 'hover' | String | 'click' |
|
||||
| changeOnSelect | 当此项为 true 时,点选每级菜单选项值都会发生变化,具体见上面的演示 | Boolean | false |
|
||||
| showSearch | 在选择框中显示搜索框 | Boolean | false |
|
||||
| notFoundContent | 当下拉列表为空时显示的内容 | String | 'Not Found' |
|
||||
| placeholder | 输入框占位文本 | string | '请选择' |
|
||||
| size | 输入框大小,可选 `large` `default` `small` | string | `default` |
|
||||
| disabled | 禁用 | boolean | false |
|
||||
| allowClear | 是否支持清除 | boolean | true |
|
||||
| expandTrigger | 次级菜单的展开方式,可选 'click' 和 'hover' | string | 'click' |
|
||||
| changeOnSelect | 当此项为 true 时,点选每级菜单选项值都会发生变化,具体见上面的演示 | boolean | false |
|
||||
| showSearch | 在选择框中显示搜索框 | boolean | false |
|
||||
| notFoundContent | 当下拉列表为空时显示的内容 | string | 'Not Found' |
|
||||
| loadData | 用于动态加载选项,无法与 `showSearch` 一起使用 | `(selectedOptions) => void` | - |
|
||||
| getPopupContainer | 菜单渲染父节点。默认渲染到 body 上,如果你遇到菜单滚动定位问题,试试修改为滚动的区域,并相对其定位。[示例](http://codepen.io/anon/pen/xVBOVQ?editors=001) | Function(triggerNode) | () => document.body |
|
||||
|
||||
@ -47,7 +47,7 @@ subtitle: 级联选择
|
||||
| 参数 | 说明 | 类型 | 默认值 |
|
||||
|------|------|------|--------|
|
||||
| filter | 接收 `inputValue` `path` 两个参数,当 `path` 符合筛选条件时,应返回 true,反之则返回 false。 | `function(inputValue, path): boolean` | |
|
||||
| render | 用于渲染 filter 后的选项 | `function(inputValue, path): React.ReactNode` | |
|
||||
| render | 用于渲染 filter 后的选项 | `function(inputValue, path): ReactNode` | |
|
||||
| sort | 用于排序 filter 后的选项 | `function(a, b, inputValue)` | |
|
||||
| matchInputWidth | 搜索结果列表是否与输入框同宽 | boolean | |
|
||||
|
||||
|
@ -17,15 +17,15 @@ Checkbox.
|
||||
|
||||
| Property | Description | Type | Default |
|
||||
|----------|------------------|----------|--------|
|
||||
| checked | Specifies whether the checkbox is selected. | Boolean | false |
|
||||
| defaultChecked | Specifies the initial state: whether or not the checkbox is selected. | Boolean | false |
|
||||
| checked | Specifies whether the checkbox is selected. | boolean | false |
|
||||
| defaultChecked | Specifies the initial state: whether or not the checkbox is selected. | boolean | false |
|
||||
| onChange | The callback function that is triggered when the state changes. | Function(e:Event) | - |
|
||||
|
||||
### Checkbox Group
|
||||
|
||||
| Property | Description | Type | Default |
|
||||
|----------|------------------|----------|--------|
|
||||
| defaultValue | Default selected value | Array | [] |
|
||||
| value | Used for setting the currently selected value. | Array | [] |
|
||||
| options | Specifies options | Array | [] |
|
||||
| defaultValue | Default selected value | string[] | [] |
|
||||
| value | Used for setting the currently selected value. | string[] | [] |
|
||||
| options | Specifies options | string[] | [] |
|
||||
| onChange | The callback function that is triggered when the state changes. | Function(checkedValue) | - |
|
||||
|
@ -18,16 +18,16 @@ title: Checkbox
|
||||
|
||||
| 参数 | 说明 | 类型 | 默认值 |
|
||||
|----------|------------------|----------|--------|
|
||||
| checked | 指定当前是否选中 | Boolean | false |
|
||||
| defaultChecked | 初始是否选中 | Boolean | false |
|
||||
| checked | 指定当前是否选中 | boolean | false |
|
||||
| defaultChecked | 初始是否选中 | boolean | false |
|
||||
| onChange | 变化时回调函数 | Function(e:Event) | - |
|
||||
| indeterminate | 设置 indeterminate 状态,只负责样式控制 | Boolean | false |
|
||||
| indeterminate | 设置 indeterminate 状态,只负责样式控制 | boolean | false |
|
||||
|
||||
### Checkbox Group
|
||||
|
||||
| 参数 | 说明 | 类型 | 默认值 |
|
||||
|----------|------------------|----------|--------|
|
||||
| defaultValue | 默认选中的选项 | Array | [] |
|
||||
| value | 指定选中的选项| Array | [] |
|
||||
| options | 指定可选项 | Array | [] |
|
||||
| defaultValue | 默认选中的选项 | string | [] |
|
||||
| value | 指定选中的选项| string | [] |
|
||||
| options | 指定可选项 | string | [] |
|
||||
| onChange | 变化时回调函数 | Function(checkedValue) | - |
|
||||
|
@ -18,13 +18,13 @@ A content area which can be collapsed and expanded.
|
||||
|
||||
| Property | Description | Type | Default |
|
||||
|----------|----------------|----------|--------------|
|
||||
| activeKey | key of the active panel | Array or String | No default value. In `accordion` mode, it's the key of the first panel. |
|
||||
| defaultActiveKey | key of the initialized active panel | String | - |
|
||||
| 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 initialized active panel | string | - |
|
||||
| onChange | a callback function, which can be executed when you switch the panels | Function | - |
|
||||
|
||||
### Collapse.Panel
|
||||
|
||||
| Property | Description | Type | Default |
|
||||
|----------|----------------|----------|--------------|
|
||||
| key | corresponds to the `activeKey` | String | - |
|
||||
| header | title of the panel | React.Element or String | - |
|
||||
| key | corresponds to the `activeKey` | string | - |
|
||||
| header | title of the panel | string\|ReactNode | - |
|
||||
|
@ -19,8 +19,8 @@ cols: 1
|
||||
|
||||
| 参数 | 说明 | 类型 | 默认值 |
|
||||
|------------------|----------------------------------------------|----------|---------------------------------|
|
||||
| activeKey | 当前激活 tab 面板的 key| Array or String | 默认无,accordion模式下默认第一个元素|
|
||||
| defaultActiveKey | 初始化选中面板的 key | String | 无 |
|
||||
| activeKey | 当前激活 tab 面板的 key| string[]\|string | 默认无,accordion模式下默认第一个元素|
|
||||
| defaultActiveKey | 初始化选中面板的 key | string | 无 |
|
||||
| onChange | 切换面板的回调 | Function | 无 |
|
||||
|
||||
|
||||
@ -28,5 +28,5 @@ cols: 1
|
||||
|
||||
| 参数 | 说明 | 类型 | 默认值 |
|
||||
|------|------------------|-------------------------|--------|
|
||||
| key | 对应 activeKey | String | 无 |
|
||||
| header | 面板头内容 | React.Element or String | 无 |
|
||||
| key | 对应 activeKey | string | 无 |
|
||||
| header | 面板头内容 | string\|ReactNode | 无 |
|
||||
|
@ -36,17 +36,17 @@ The following APIs are shared by DatePicker, MonthPicker, RangePicker.
|
||||
|
||||
| Property | Description | Type | Default |
|
||||
|--------------|----------------|----------|--------------|
|
||||
| allowClear | Whether to show clear button | bool | true |
|
||||
| disabled | determine whether the DatePicker is disabled | Boolean | false |
|
||||
| style | to customize the style of the input box | 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 32px and 22px respectively, while default size is 28px | String | - |
|
||||
| locale | localization configuration | Object | [default](https://github.com/ant-design/ant-design/blob/master/components/date-picker/locale/example.json) |
|
||||
| allowClear | Whether to show clear button | boolean | true |
|
||||
| disabled | determine whether the DatePicker is disabled | boolean | false |
|
||||
| style | to customize the style of the input box | 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 32px and 22px respectively, while default size is 28px | string | - |
|
||||
| locale | localization configuration | object | [default](https://github.com/ant-design/ant-design/blob/master/components/date-picker/locale/example.json) |
|
||||
| disabledDate | to specify the date that cannot be selected | function | - |
|
||||
| getCalendarContainer | to set the container of the floating layer, while the default is to create a `div` element in `body` | function(trigger) | - |
|
||||
| open | open state of picker | bool | - |
|
||||
| open | open state of picker | boolean | - |
|
||||
| onOpenChange | a callback function, can be executed whether the popup calendar is popped up or closed | function(status) | - |
|
||||
| placeholder | placeholder of date input | string or array (RangePicker) | - |
|
||||
| placeholder | placeholder of date input | string\|RangePicker[] | - |
|
||||
|
||||
### DatePicker
|
||||
|
||||
@ -54,10 +54,10 @@ The following APIs are shared by DatePicker, MonthPicker, RangePicker.
|
||||
|--------------|----------------|----------|--------------|
|
||||
| value | to set date | [moment](http://momentjs.com/) | - |
|
||||
| defaultValue | to set default date | [moment](http://momentjs.com/) | - |
|
||||
| format | to set the date format, refer to [moment.js](http://momentjs.com/) | String | "YYYY-MM-DD" |
|
||||
| format | to set the date format, refer to [moment.js](http://momentjs.com/) | string | "YYYY-MM-DD" |
|
||||
| onChange | a callback function, can be executed when the selected time is changing | function(date: moment, dateString: string) | - |
|
||||
| showTime | to provide an additional time selection | Object/Boolean | [TimePicker Options](/components/time-picker/#api) |
|
||||
| showToday | whether to show "Today" button | Boolean | true |
|
||||
| showTime | to provide an additional time selection | object\|boolean | [TimePicker Options](/components/time-picker/#api) |
|
||||
| showToday | whether to show "Today" button | boolean | true |
|
||||
| disabledTime | to specify the time that cannot be selected | function(date) | - |
|
||||
|
||||
### MonthPicker
|
||||
@ -66,9 +66,9 @@ The following APIs are shared by DatePicker, MonthPicker, RangePicker.
|
||||
|--------------|----------------|----------|--------------|
|
||||
| value | to set date | [moment](http://momentjs.com/) | - |
|
||||
| defaultValue | to set default date | [moment](http://momentjs.com/) | - |
|
||||
| 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" |
|
||||
| onChange | a callback function, can be executed when the selected time is changing | function(date: moment, dateString: string) | - |
|
||||
| monthCellContentRender | Custom month cell content render method | function(date, locale): React.Node | - |
|
||||
| monthCellContentRender | Custom month cell content render method | function(date, locale): ReactNode | - |
|
||||
|
||||
### RangePicker
|
||||
|
||||
@ -76,11 +76,11 @@ The following APIs are shared by DatePicker, MonthPicker, RangePicker.
|
||||
|--------------|----------------|----------|--------------|
|
||||
| value | to set date | [[moment](http://momentjs.com/), [moment](http://momentjs.com/)] | - |
|
||||
| defaultValue | to set default date | [[moment](http://momentjs.com/), [moment](http://momentjs.com/)] | - |
|
||||
| format | to set the date format | String | "YYYY-MM-DD HH:mm:ss" |
|
||||
| format | to set the date format | string | "YYYY-MM-DD HH:mm:ss" |
|
||||
| onChange | a callback function, can be executed when the selected time is changing | function(dates: [moment, moment], dateStrings: [string, string]) | - |
|
||||
| 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) |
|
||||
| disabledTime | to specify the time that cannot be selected | function(dates: [moment, moment], partial: `'start'|'end'`) | - |
|
||||
| ranges | preseted ranges for quick selection | Object { [range: string]: [moment, moment] } | - |
|
||||
| ranges | preseted ranges for quick selection | { [range: string]: [moment](http://momentjs.com/)[] } | - |
|
||||
|
||||
<style>
|
||||
.code-box-demo .ant-calendar-picker {
|
||||
|
@ -37,17 +37,17 @@ moment.locale('zh-cn');
|
||||
|
||||
| 参数 | 说明 | 类型 | 默认值 |
|
||||
|--------------|----------------|----------|--------------|
|
||||
| allowClear | 是否显示清除按钮 | bool | true |
|
||||
| disabled | 禁用 | bool | false |
|
||||
| allowClear | 是否显示清除按钮 | boolean | true |
|
||||
| disabled | 禁用 | boolean | false |
|
||||
| style | 自定义输入框样式 | object | {} |
|
||||
| popupStyle | 格外的弹出日历样式 | object | {} |
|
||||
| size | 输入框大小,`large` 高度为 32px,`small` 为 22px,默认是 28px | string | 无 |
|
||||
| locale | 国际化配置 | object | [默认配置](https://github.com/ant-design/ant-design/blob/master/components/date-picker/locale/example.json) |
|
||||
| disabledDate | 不可选择的日期 | function | 无 |
|
||||
| getCalendarContainer | 定义浮层的容器,默认为 body 上新建 div | function(trigger) | 无 |
|
||||
| open | 控制弹层是否展开 | bool | - |
|
||||
| open | 控制弹层是否展开 | boolean | - |
|
||||
| onOpenChange | 弹出日历和关闭日历的回调 | function(status) | 无 |
|
||||
| placeholder | 输入框提示文字 | string or array (RangePicker) | - |
|
||||
| placeholder | 输入框提示文字 | string\|RangePicker[] | - |
|
||||
|
||||
### DatePicker
|
||||
|
||||
@ -57,8 +57,8 @@ moment.locale('zh-cn');
|
||||
| defaultValue | 默认日期 | [moment](http://momentjs.com/) | 无 |
|
||||
| format | 展示的日期格式,配置参考 [moment.js](http://momentjs.com/) | string | "YYYY-MM-DD" |
|
||||
| onChange | 时间发生变化的回调 | function(date: moment, dateString: string) | 无 |
|
||||
| showTime | 增加时间选择功能 | Object or Boolean | [TimePicker Options](/components/time-picker/#api) |
|
||||
| showToday | 是否展示“今天”按钮 | Boolean | true |
|
||||
| showTime | 增加时间选择功能 | Object\|boolean | [TimePicker Options](/components/time-picker/#api) |
|
||||
| showToday | 是否展示“今天”按钮 | boolean | true |
|
||||
| disabledTime | 不可选择的时间 | function(date) | 无 |
|
||||
|
||||
### MonthPicker
|
||||
@ -69,19 +69,19 @@ moment.locale('zh-cn');
|
||||
| defaultValue | 默认日期 | [moment](http://momentjs.com/) | 无 |
|
||||
| format | 展示的日期格式,配置参考 [moment.js](http://momentjs.com/) | string | "YYYY-MM" |
|
||||
| onChange | 时间发生变化的回调,发生在用户选择时间时 | function(date: moment, dateString: string) | - |
|
||||
| monthCellContentRender | 自定义的月份内容渲染方法 | function(date, locale): React.Node | - |
|
||||
| monthCellContentRender | 自定义的月份内容渲染方法 | function(date, locale): ReactNode | - |
|
||||
|
||||
### RangePicker
|
||||
|
||||
| 参数 | 说明 | 类型 | 默认值 |
|
||||
|--------------|----------------|----------|--------------|
|
||||
| value | 日期 | [[moment](http://momentjs.com/), [moment](http://momentjs.com/)] | 无 |
|
||||
| defaultValue | 默认日期 | [[moment](http://momentjs.com/), [moment](http://momentjs.com/)] | 无 |
|
||||
| value | 日期 | [moment](http://momentjs.com/)[] | 无 |
|
||||
| defaultValue | 默认日期 | [moment](http://momentjs.com/)[] | 无 |
|
||||
| format | 展示的日期格式 | string | "YYYY-MM-DD HH:mm:ss" |
|
||||
| onChange | 时间发生变化的回调,发生在用户选择时间时 | function(dates: [moment, moment], dateStrings: [string, string]) | 无 |
|
||||
| showTime | 增加时间选择功能 | Object or Boolean | [TimePicker Options](/components/time-picker/#api) |
|
||||
| showTime | 增加时间选择功能 | Object\|boolean | [TimePicker Options](/components/time-picker/#api) |
|
||||
| disabledTime | 不可选择的时间 | function(dates: [moment, moment], partial: `'start'|'end'`) | 无 |
|
||||
| ranges | 预设事件范围快捷选择 | Object { [range: string]: [moment, moment] } | 无 |
|
||||
| ranges | 预设事件范围快捷选择 | { [range: string]: [moment](http://momentjs.com/)[] } | 无 |
|
||||
|
||||
<style>
|
||||
.code-box-demo .ant-calendar-picker {
|
||||
|
@ -16,10 +16,10 @@ If there are too many operations to display, you can wrap them in a `Dropdown`.
|
||||
|
||||
| Property | Description | Type | Default |
|
||||
|--------------|----------------|----------|--------------|
|
||||
| trigger | the trigger mode which can execute the drop-down action | ['click'] or ['hover'] | ['hover'] |
|
||||
| trigger | the trigger mode which can execute the drop-down action | Array<'click'\|'hover'> | ['hover'] |
|
||||
| overlay | the dropdown menu | [Menu](/components/menu) | - |
|
||||
| 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](http://codepen.io/anon/pen/xVBOVQ?editors=001) | Function(triggerNode) | () => document.body |
|
||||
| visible | determine whether the dropdown menu is visible | Boolean | - |
|
||||
| visible | determine whether the dropdown menu is visible | boolean | - |
|
||||
| onVisibleChange | a callback function takes an argument: `visible`, can be executed when the visible state is changing | Function | - |
|
||||
|
||||
You can get the menu list by `antd.Menu`, and set a callback function `onSelect` for it if you need. The menu items and the dividers are also available, by using `antd.Menu.Item` and `antd.Menu.Divider` respectively.
|
||||
@ -31,9 +31,9 @@ You can get the menu list by `antd.Menu`, and set a callback function `onSelect`
|
||||
|
||||
| Property | Description | Type | Default |
|
||||
|--------------|----------------|----------|--------------|
|
||||
| type | type of the button, the same as [Button](/components/button) | String | 'default' |
|
||||
| type | type of the button, the same as [Button](/components/button) | string | 'default' |
|
||||
| onClick | a callback function, the same as [Button](/components/button), which will be executed when you click the button on the left | Function | - |
|
||||
| trigger | the trigger mode which can execute the drop-down action | ['click'] or ['hover'] | ['hover'] |
|
||||
| trigger | the trigger mode which can execute the drop-down action | Array<'click'\|'hover'> | ['hover'] |
|
||||
| overlay | the dropdown menu | [Menu](/components/menu) | - |
|
||||
| visible | determine whether the dropdown menu is visible | Boolean | - |
|
||||
| visible | determine whether the dropdown menu is visible | boolean | - |
|
||||
| onVisibleChange | a callback function takes an argument: `visible`, can be executed when the visible state is changing | Function | - |
|
||||
|
@ -17,10 +17,10 @@ title: Dropdown
|
||||
|
||||
| 参数 | 说明 | 类型 | 默认值 |
|
||||
|-------------|------------------|--------------------|--------------|
|
||||
| trigger | 触发下拉的行为 | ['click'] or ['hover'] | ['hover'] |
|
||||
| trigger | 触发下拉的行为 | Array<'click'\|'hover'> | ['hover'] |
|
||||
| overlay | 菜单 | [Menu](/components/menu) | - |
|
||||
| getPopupContainer | 菜单渲染父节点。默认渲染到 body 上,如果你遇到菜单滚动定位问题,试试修改为滚动的区域,并相对其定位。[示例](http://codepen.io/anon/pen/xVBOVQ?editors=001) | Function(triggerNode) | () => document.body |
|
||||
| visible | 菜单是否显示 | Boolean | - |
|
||||
| visible | 菜单是否显示 | boolean | - |
|
||||
| onVisibleChange | 菜单显示状态改变时调用,参数为 visible | Function | - |
|
||||
|
||||
菜单可由 `antd.Menu` 取得,可设置 `onSelect` 回调,菜单还包括菜单项 `antd.Menu.Item`,分割线 `antd.Menu.Divider`。
|
||||
@ -31,9 +31,9 @@ title: Dropdown
|
||||
|
||||
| 参数 | 说明 | 类型 | 默认值 |
|
||||
|-------------|------------------|--------------------|--------------|
|
||||
| type | 按钮类型,和 [Button](/components/button/) 一致 | String | 'default' |
|
||||
| type | 按钮类型,和 [Button](/components/button/) 一致 | string | 'default' |
|
||||
| onClick | 点击左侧按钮的回调,和 [Button](/components/button/) 一致 | Function | - |
|
||||
| trigger | 触发下拉的行为 | ['click'] or ['hover'] | ['hover'] |
|
||||
| trigger | 触发下拉的行为 | Array<'click'\|'hover'> | ['hover'] |
|
||||
| overlay | 菜单 | [Menu](/components/menu/) | - |
|
||||
| visible | 菜单是否显示 | Boolean | - |
|
||||
| visible | 菜单是否显示 | boolean | - |
|
||||
| onVisibleChange | 菜单显示状态改变时调用,参数为 visible | Function | - |
|
||||
|
@ -95,8 +95,8 @@ If you use `react@<15.3.0`, then, you can't use `getFieldDecorator` in stateless
|
||||
| options.initialValue | You can specify initial value, type, optional value of children node. | | n/a |
|
||||
| options.trigger | When to collect the value of children node | string | 'onChange' |
|
||||
| options.getValueFromEvent | To convert parameters of onChange to the value of control | function(..args) | [reference](https://github.com/react-component/form#optiongetvaluefromevent) |
|
||||
| options.validateTrigger | When to validate the value of children node. | string \| string[] | 'onChange' |
|
||||
| options.rules | Includes validation rules. Please refer to [async-validator](https://github.com/yiminghe/async-validator#rules) for details. | array | n/a |
|
||||
| options.validateTrigger | When to validate the value of children node. | string\|string[] | 'onChange' |
|
||||
| options.rules | Includes validation rules. Please refer to [async-validator](https://github.com/yiminghe/async-validator#rules) for details. | object[] | n/a |
|
||||
| options.exclusive | Whether it is exclusive with other controls, particularly for Radio. | boolean | false |
|
||||
|
||||
### Form.Item
|
||||
@ -107,11 +107,11 @@ Note:
|
||||
|
||||
| Property | Description | Type | Default Value |
|
||||
|---------------|--------------------------------------|--------|---------------|
|
||||
| label | Label text | React.Node | |
|
||||
| label | Label text | string\|ReactNode | |
|
||||
| labelCol | The layout of label. You can set `span` `offset` to something like `{span: 3, offset: 12}` same as with `<Col>` | object | |
|
||||
| wrapperCol | The layout for input controls. Same as `labelCol` | object | |
|
||||
| help | The prompt message. If not provided, the prompt message will be generated by the validation rule. | React.Node | |
|
||||
| extra | The extra prompt message. It is similar to help. Usage example: to display error message and prompt message at the same time. | React.Node | |
|
||||
| help | The prompt message. If not provided, the prompt message will be generated by the validation rule. | string\|ReactNode | |
|
||||
| extra | The extra prompt message. It is similar to help. Usage example: to display error message and prompt message at the same time. | string\|ReactNode | |
|
||||
| required | Whether provided or not, it will be generated by the validation rule. | boolean | false |
|
||||
| validateStatus | The validation status. If not provided, it will be generated by validation rule. options: 'success' 'warning' 'error' 'validating' | string | |
|
||||
| hasFeedback | Used with `validateStatus`, this option specifies the validation status icon. Recommended to be used only with `Input`. | boolean | false |
|
||||
|
@ -96,8 +96,8 @@ CustomizedForm = Form.create({})(CustomizedForm);
|
||||
| options.initialValue | 子节点的初始值,类型、可选值均由子节点决定 | | |
|
||||
| options.trigger | 收集子节点的值的时机 | string | 'onChange' |
|
||||
| options.getValueFromEvent | 可以把 onChange 的参数转化为控件的值 | function(..args) | [reference](https://github.com/react-component/form#optiongetvaluefromevent) |
|
||||
| options.validateTrigger | 校验子节点值的时机 | string \| string[] | 'onChange' |
|
||||
| options.rules | 校验规则,参见 [async-validator](https://github.com/yiminghe/async-validator#rules) | array | |
|
||||
| options.validateTrigger | 校验子节点值的时机 | string\|string[] | 'onChange' |
|
||||
| options.rules | 校验规则,参见 [async-validator](https://github.com/yiminghe/async-validator#rules) | object[] | |
|
||||
| options.exclusive | 是否和其他控件互斥,特别用于 Radio 单选控件 | boolean | false |
|
||||
|
||||
### Form.Item
|
||||
@ -108,11 +108,11 @@ CustomizedForm = Form.create({})(CustomizedForm);
|
||||
|
||||
| 参数 | 说明 | 类型 | 默认值 |
|
||||
|-----------|-----------------------------------------|-----------|--------|
|
||||
| label | label 标签的文本 | React.Node | |
|
||||
| label | label 标签的文本 | string\|ReactNode | |
|
||||
| labelCol | label 标签布局,通 `<Col>` 组件,设置 `span` `offset` 值,如 `{span: 3, offset: 12}` | object | |
|
||||
| wrapperCol | 需要为输入控件设置布局样式时,使用该属性,用法同 labelCol | object | |
|
||||
| help | 提示信息,如不设置,则会根据校验规则自动生成 | React.Node | |
|
||||
| extra | 额外的提示信息,和 help 类似,当需要错误信息和提示文案同时出现时,可以使用这个。 | React.Node | |
|
||||
| help | 提示信息,如不设置,则会根据校验规则自动生成 | string\|ReactNode | |
|
||||
| extra | 额外的提示信息,和 help 类似,当需要错误信息和提示文案同时出现时,可以使用这个。 | string\|ReactNode | |
|
||||
| required | 是否必填,如不设置,则会根据校验规则自动生成 | boolean | false |
|
||||
| validateStatus | 校验状态,如不设置,则会根据校验规则自动生成,可选:'success' 'warning' 'error' 'validating' | string | |
|
||||
| hasFeedback | 配合 validateStatus 属性使用,展示校验状态图标,建议只配合 Input 组件使用 | boolean | false |
|
||||
|
@ -103,7 +103,7 @@ Ant Design 的布局组件若不能满足你的需求,你也可以直接使用
|
||||
| offset | 栅格左侧的间隔格数,间隔内不可以有栅格 | number | 0 |
|
||||
| push | 栅格向右移动格数 | number | 0 |
|
||||
| pull | 栅格向左移动格数 | number | 0 |
|
||||
| xs | `<768px` 响应式栅格,可为栅格数或一个包含其他属性的对象 | number or object | - |
|
||||
| sm | `≥768px` 响应式栅格,可为栅格数或一个包含其他属性的对象 | number or object | - |
|
||||
| md | `≥992px` 响应式栅格,可为栅格数或一个包含其他属性的对象 | number or object | - |
|
||||
| lg | `≥1200px` 响应式栅格,可为栅格数或一个包含其他属性的对象 | number or object | - |
|
||||
| xs | `<768px` 响应式栅格,可为栅格数或一个包含其他属性的对象 | number\|object | - |
|
||||
| sm | `≥768px` 响应式栅格,可为栅格数或一个包含其他属性的对象 | number\|object | - |
|
||||
| md | `≥992px` 响应式栅格,可为栅格数或一个包含其他属性的对象 | number\|object | - |
|
||||
| lg | `≥1200px` 响应式栅格,可为栅格数或一个包含其他属性的对象 | number\|object | - |
|
||||
|
@ -14,11 +14,11 @@ When a numeric value needs to be provided.
|
||||
|
||||
| property | description | type | default |
|
||||
|-------------|----------------|--------------------|--------------|
|
||||
| min | min value | Number | -Infinity |
|
||||
| max | max vale | Number | Infinity |
|
||||
| value | current value | Number | |
|
||||
| step | The number to which the current value is increased or decreased. It can be an integer or decimal. | Number or String | 1 |
|
||||
| defaultValue | initial value | Number | |
|
||||
| min | min value | number | -Infinity |
|
||||
| max | max vale | number | Infinity |
|
||||
| value | current value | number | |
|
||||
| step | The number to which the current value is increased or decreased. It can be an integer or decimal. | number\|string | 1 |
|
||||
| defaultValue | initial value | number | |
|
||||
| onChange | The callback triggered when the value is changed. | Function | |
|
||||
| disabled | disable the input | Boolean | false |
|
||||
| size | width of input box | String | none |
|
||||
| disabled | disable the input | boolean | false |
|
||||
| size | width of input box | string | none |
|
||||
|
@ -17,11 +17,11 @@ title: InputNumber
|
||||
|
||||
| 成员 | 说明 | 类型 | 默认值 |
|
||||
|-------------|----------------|--------------------|--------------|
|
||||
| min | 最小值 | Number | -Infinity |
|
||||
| max | 最大值 | Number | Infinity |
|
||||
| value | 当前值 | Number | |
|
||||
| step | 每次改变步数,可以为小数 | Number or String | 1 |
|
||||
| defaultValue | 初始值 | Number | |
|
||||
| min | 最小值 | number | -Infinity |
|
||||
| max | 最大值 | number | Infinity |
|
||||
| value | 当前值 | number | |
|
||||
| step | 每次改变步数,可以为小数 | number\|string | 1 |
|
||||
| defaultValue | 初始值 | number | |
|
||||
| onChange | 变化回调 | Function | |
|
||||
| disabled | 禁用 | Boolean | false |
|
||||
| size | 输入框大小 | String | 无 |
|
||||
| disabled | 禁用 | boolean | false |
|
||||
| size | 输入框大小 | string | 无 |
|
||||
|
@ -24,12 +24,12 @@ Keyboard and mouse can be used for providing or changing data.
|
||||
| defaultValue | The initial input content | string | |
|
||||
| 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` |
|
||||
| disabled | Tell if the input is disabled. | boolean | false |
|
||||
| addonBefore | The label text displayed before (on the left side of) the input field. | React.Node | |
|
||||
| addonAfter | The label text displayed after (on the right side of) the input field. | React.Node | |
|
||||
| prefix | The Input with prefix icon. | React.Node | |
|
||||
| suffix | The Input with suffix icon. | React.Node | |
|
||||
| addonBefore | The label text displayed before (on the left side of) the input field. | string\|ReactNode | |
|
||||
| addonAfter | The label text displayed after (on the right side of) the input field. | string\|ReactNode | |
|
||||
| prefix | The Input with prefix icon. | string\|ReactNode | |
|
||||
| suffix | The Input with suffix icon. | string\|ReactNode | |
|
||||
| onPressEnter | The callback function that is triggered when pressing Enter key. | function(e) | |
|
||||
| autosize | Height autosize feature, available when type="textarea", can be set to `true|false` or a object `{ minRows: 2, maxRows: 6 }` | boolean or object | false |
|
||||
| autosize | Height autosize feature, available when type="textarea", can be set to `true|false` or a object `{ minRows: 2, maxRows: 6 }` | boolean\|object | false |
|
||||
|
||||
> 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 are automatically set.
|
||||
|
@ -24,12 +24,12 @@ title: Input
|
||||
| defaultValue | 输入框默认内容 | string | |
|
||||
| size | 控件大小。注:标准表单内的输入框大小限制为 `large`。可选 `large` `default` `small` | string | `default` |
|
||||
| disabled | 是否禁用状态,默认为 false | boolean | false |
|
||||
| addonBefore | 带标签的 input,设置前置标签 | React.Node | |
|
||||
| addonAfter | 带标签的 input,设置后置标签 | React.Node | |
|
||||
| prefix | 带有前缀图标的 input | React.Node | |
|
||||
| suffix | 带有后缀图标的 input | React.Node | |
|
||||
| addonBefore | 带标签的 input,设置前置标签 | string\|ReactNode | |
|
||||
| addonAfter | 带标签的 input,设置后置标签 | string\|ReactNode | |
|
||||
| prefix | 带有前缀图标的 input | string\|ReactNode | |
|
||||
| suffix | 带有后缀图标的 input | string\|ReactNode | |
|
||||
| onPressEnter | 按下回车的回调 | function(e) | |
|
||||
| autosize | 自适应内容高度,只对 `type="textarea"` 有效,可设置为 `true|false` 或对象:`{ minRows: 2, maxRows: 6 }` | boolean or object | false |
|
||||
| autosize | 自适应内容高度,只对 `type="textarea"` 有效,可设置为 `true|false` 或对象:`{ minRows: 2, maxRows: 6 }` | boolean\|object | false |
|
||||
|
||||
> 如果 `Input` 在 `Form.Item` 内,并且 `Form.Item` 设置了 `id` 和 `options` 属性,则 `value` `defaultValue` 和 `id` 属性会被自动设置。
|
||||
|
||||
|
@ -37,7 +37,7 @@ The wrapper.
|
||||
|
||||
Property | Description | Type | Default
|
||||
-----|-----|-----|------
|
||||
style | to custom the styles | Object | -
|
||||
style | to custom the styles | object | -
|
||||
className | container className | string | -
|
||||
|
||||
> API of `Layout.Header` `Layout.Footer` `Layout.Content` is the same with `Layout`.
|
||||
@ -48,12 +48,12 @@ The sidebar.
|
||||
|
||||
Property | Description | Type | Default
|
||||
-----|-----|-----|------
|
||||
collapsible | whether can be collapsed | Boolean | false
|
||||
defaultCollapsed | to set the initial status | Boolean | false |
|
||||
collapsed | to set the current status | Boolean | -
|
||||
collapsible | whether can be collapsed | boolean | false
|
||||
defaultCollapsed | to set the initial status | boolean | false |
|
||||
collapsed | to set the current status | boolean | -
|
||||
onCollapse | the callback function, can be executed when you switch the sidebar, available only `collapsible: true` | (collapsed) => {} | -
|
||||
trigger | specify the customized trigger, set to null to hide the trigger | React.ReactNode or null | - |
|
||||
width | width of the sidebar | Number or String | 200
|
||||
collapsedWidth | width of the collapsed sidebar, available only `collapsible: true` | Number | 64
|
||||
style | to custom the styles | Object | -
|
||||
trigger | specify the customized trigger, set to null to hide the trigger | string\|ReactNode| - |
|
||||
width | width of the sidebar | number\|string | 200
|
||||
collapsedWidth | width of the collapsed sidebar, available only `collapsible: true` | number | 64
|
||||
style | to custom the styles | object | -
|
||||
className | container className | string | -
|
||||
|
@ -38,7 +38,7 @@ title: Layout
|
||||
|
||||
| 参数 | 说明 | 类型 | 默认值 |
|
||||
|----------|------------------------------------------|-------------|-------|
|
||||
| style | 指定样式 | Object | - |
|
||||
| style | 指定样式 | object | - |
|
||||
| className | 容器 className | string | - |
|
||||
|
||||
> `Layout.Header` `Layout.Footer` `Layout.Content` API 与 `Layout` 相同
|
||||
@ -49,12 +49,12 @@ title: Layout
|
||||
|
||||
| 参数 | 说明 | 类型 | 默认值 |
|
||||
|----------|-----------------------------------------|------------|-------|
|
||||
| collapsible | 是否可收起 | Boolean | false |
|
||||
| defaultCollapsed | 是否默认收起 | Boolean | false |
|
||||
| collapsed | 当前收起状态 | Boolean | - |
|
||||
| collapsible | 是否可收起 | boolean | false |
|
||||
| defaultCollapsed | 是否默认收起 | boolean | false |
|
||||
| collapsed | 当前收起状态 | boolean | - |
|
||||
| onCollapse | 展开-收起时的回调函数,仅当 `collapsible:true` 时生效 | (collapsed) => {} | - |
|
||||
| trigger | 自定义 trigger,设置为 null 时隐藏 trigger | React.ReactNode or null | - |
|
||||
| width | 宽度 | Number or String | 200 |
|
||||
| collapsedWidth | 收缩宽度,仅当 `collapsible:true` 时生效 | Number | 64 |
|
||||
| style | 指定样式 | Object | - |
|
||||
| trigger | 自定义 trigger,设置为 null 时隐藏 trigger | string\|ReactNode | - |
|
||||
| width | 宽度 | number\|string | 200 |
|
||||
| collapsedWidth | 收缩宽度,仅当 `collapsible:true` 时生效 | number | 64 |
|
||||
| style | 指定样式 | object | - |
|
||||
| className | 容器 className | string | - |
|
||||
|
@ -32,4 +32,4 @@ This component aims for localization of the built-in text, if you want to suppor
|
||||
|
||||
Property | Description | Type | Default
|
||||
-----|-----|-----|------
|
||||
locale | language package setting, you can find the packages in this path: `antd/lib/locale-provider/` | Object | -
|
||||
locale | language package setting, you can find the packages in this path: `antd/lib/locale-provider/` | object | -
|
||||
|
@ -33,4 +33,4 @@ We supply an English locale package. Other language users can create a locale pa
|
||||
|
||||
| 参数 | 说明 | 类型 | 默认值 |
|
||||
|--------|----------------|------------------|--------------|
|
||||
| locale | 语言包配置,语言包可到 `antd/lib/locale-provider/` 目录下寻找 | Object | - |
|
||||
| locale | 语言包配置,语言包可到 `antd/lib/locale-provider/` 目录下寻找 | object | - |
|
||||
|
@ -23,20 +23,20 @@ When need to mention someone or something.
|
||||
|
||||
| API | Description | Type |
|
||||
|----------|---------------|----------|--------------|
|
||||
| toString | convert EditorState to string | Function(editorState: EditorState): String |
|
||||
| toEditorState | convert string to EditorState | Function(string: String): EditorState |
|
||||
| getMentions | get mentioned people in current editorState | Function(editorState: EditorState): Array<String> |
|
||||
| toString | convert EditorState to string | Function(editorState: EditorState): string |
|
||||
| toEditorState | convert string to EditorState | Function(value: string): EditorState |
|
||||
| getMentions | get mentioned people in current editorState | Function(editorState: EditorState): string[] |
|
||||
|
||||
|
||||
### Mention props
|
||||
|
||||
| Property | Description | Type | Default |
|
||||
|----------|---------------|----------|--------------|
|
||||
| suggestions | suggestion content | Array<string> or Array<Mention.Nav> | [] |
|
||||
| suggestionStyle | style of suggestion container | Object | {} |
|
||||
| onSearchChange | Callback function called when search content changes | function(value:String) | [] |
|
||||
| suggestions | suggestion content | Array<string\|Mention.Nav> | [] |
|
||||
| suggestionStyle | style of suggestion container | object | {} |
|
||||
| onSearchChange | Callback function called when search content changes | function(value:string) | [] |
|
||||
| onChange | Callback function called when content of input changes | function(editorState: EditorState) | null |
|
||||
| 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 |
|
||||
| notFoundContent| suggestion when suggestions empty | string | '无匹配结果,轻敲空格完成输入' |
|
||||
| loading | loading mode | boolean | false |
|
||||
| multiLines | multilines mode | boolean | false |
|
||||
@ -53,4 +53,4 @@ When need to mention someone or something.
|
||||
| Property | Description | Type | Default |
|
||||
|----------|---------------|----------|--------------|
|
||||
| value | value of suggestion,the value will insert into input filed while selected | string | "" |
|
||||
| children | suggestion content | Object | {} |
|
||||
| children | suggestion content | object | {} |
|
||||
|
@ -24,19 +24,19 @@ title: Mention
|
||||
|
||||
| API | 说明 | 类型 |
|
||||
|----------|---------------|----------|
|
||||
| toString | 把 EditorState 转成字符串 | Function(editorState: EditorState): String |
|
||||
| toEditorState | 把字符串转成 EditorState | Function(string: String): EditorState |
|
||||
| getMentions | 获取当前 editorState 中提到的人的列表 | Function(editorState: EditorState): Array<String> |
|
||||
| toString | 把 EditorState 转成字符串 | Function(editorState: EditorState): string |
|
||||
| toEditorState | 把字符串转成 EditorState | Function(value: string): EditorState |
|
||||
| getMentions | 获取当前 editorState 中提到的人的列表 | Function(editorState: EditorState): string[] |
|
||||
|
||||
### Mention props
|
||||
|
||||
| 参数 | 说明 | 类型 | 默认值 |
|
||||
|----------|---------------|----------|--------------|
|
||||
| suggestions | 建议内容 | Array<string> or Array<Mention.Nav> | [] |
|
||||
| suggestionStyle | 弹出下拉框样式 | Object | {} |
|
||||
| onSearchChange | 输入框中 @ 变化时回调 | function(value:String) | [] |
|
||||
| suggestions | 建议内容 | Array<string\|Mention.Nav> | [] |
|
||||
| suggestionStyle | 弹出下拉框样式 | object | {} |
|
||||
| onSearchChange | 输入框中 @ 变化时回调 | function(value:string) | [] |
|
||||
| onChange | 输入框内容变化时回调 | function(editorState: EditorState) | null |
|
||||
| onSelect | 下拉框选择建议时回调 | function(suggestion: String, data?: any) | null |
|
||||
| onSelect | 下拉框选择建议时回调 | function(suggestion: string, data?: any) | null |
|
||||
| notFoundContent| 未找到时的内容 | string | '无匹配结果,轻敲空格完成输入' |
|
||||
| loading | 加载中 | boolean | false |
|
||||
| multiLines | 多行模式 | boolean | false |
|
||||
@ -53,4 +53,4 @@ title: Mention
|
||||
| 参数 | 说明 | 类型 | 默认值 |
|
||||
|----------|---------------|----------|--------------|
|
||||
| value | 建议值,选择建议时,用此值插入到输入框中 | string | "" |
|
||||
| children | 建议内容 | Object | {} |
|
||||
| children | 建议内容 | object | {} |
|
||||
|
@ -28,17 +28,17 @@ More layout and samples: [layout](/docs/spec/layout).
|
||||
|
||||
| Param | Description | Type | Default value |
|
||||
|----------|---------------|----------|--------------|
|
||||
| theme | color of the theme | String: `light` `dark` | `light` |
|
||||
| mode | type of the menu; vertical, horizontal, and inline modes are supported | String: vertical horizontal inline | vertical |
|
||||
| selectedKeys | array with the keys of currently selected menu items | Array | |
|
||||
| defaultSelectedKeys | array with the keys of default selected menu items | Array | |
|
||||
| openKeys | array with the keys of currently opened sub menus | Array | |
|
||||
| theme | color of the theme | string: `light` `dark` | `light` |
|
||||
| mode | type of the menu; vertical, horizontal, and inline modes are supported | string: vertical horizontal inline | vertical |
|
||||
| selectedKeys | array with the keys of currently selected menu items | string[] | |
|
||||
| defaultSelectedKeys | array with the keys of default selected menu items | string[] | |
|
||||
| openKeys | array with the keys of currently opened sub menus | string[] | |
|
||||
| defaultOpenKeys | array with the keys of default opened sub menus | | |
|
||||
| onOpenChange | called when open/close sub menu | Function(openKeys: string[]) | noop |
|
||||
| onSelect | callback of the selected item | Function({ item, key, selectedKeys }) | none |
|
||||
| onDeselect | callback of the deselected item, only supported for multiple mode | Function({ item, key, selectedKeys }) | - |
|
||||
| onClick | callback of the clicked menu item, params: {item, key, keyPath} | function | - |
|
||||
| style | style of the root node | Object | |
|
||||
| style | style of the root node | object | |
|
||||
| inlineIndent | indent px of inline menu item on each level | number | 24 |
|
||||
|
||||
> More options in [rc-menu](https://github.com/react-component/menu#api)
|
||||
@ -47,24 +47,24 @@ More layout and samples: [layout](/docs/spec/layout).
|
||||
|
||||
| Param | Description | Type | Default value |
|
||||
|----------|----------------|----------|--------------|
|
||||
| disabled | disabled or not | Boolean | false |
|
||||
| key | unique id of the menu item | String | |
|
||||
| disabled | disabled or not | boolean | false |
|
||||
| key | unique id of the menu item | string | |
|
||||
|
||||
### Menu.SubMenu props
|
||||
|
||||
| Param | Description | Type | Default value |
|
||||
|----------|----------------|----------|--------------|
|
||||
| disabled | disabled or not | Boolean | false |
|
||||
| key | unique id of the menu item | String | |
|
||||
| title | title of the sub menu | String or React.Element | |
|
||||
| children | sub menus or sub menu items | (MenuItem or SubMenu)[] | |
|
||||
| disabled | disabled or not | boolean | false |
|
||||
| key | unique id of the menu item | string | |
|
||||
| title | title of the sub menu | string\|ReactNode | |
|
||||
| children | sub menus or sub menu items | Arrat<MenuItem\|SubMenu> | |
|
||||
| onTitleClick | callback of the clicked sub menu title | Function({ eventKey, domEvent }) | |
|
||||
|
||||
### Menu.ItemGroup props
|
||||
|
||||
| Param | Description | Type | Default value |
|
||||
|----------|----------------|----------|--------------|
|
||||
| title | title of the group | String or React.Element | |
|
||||
| title | title of the group | string\|ReactNode | |
|
||||
| children | sub menu items | MenuItem[] | |
|
||||
|
||||
### Menu.Divider
|
||||
|
@ -29,17 +29,17 @@ subtitle: 导航菜单
|
||||
|
||||
| 参数 | 说明 | 类型 | 默认值 |
|
||||
|----------|---------------|----------|--------------|
|
||||
| theme | 主题颜色 | String: `light` `dark` | `light` |
|
||||
| mode | 菜单类型,现在支持垂直、水平、和内嵌模式三种 | String: `vertical` `horizontal` `inline` | `vertical` |
|
||||
| selectedKeys | 当前选中的菜单项 key 数组 | Array | |
|
||||
| defaultSelectedKeys | 初始选中的菜单项 key 数组 | Array | |
|
||||
| openKeys | 当前展开的 SubMenu 菜单项 key 数组 | Array | |
|
||||
| theme | 主题颜色 | string: `light` `dark` | `light` |
|
||||
| mode | 菜单类型,现在支持垂直、水平、和内嵌模式三种 | string: `vertical` `horizontal` `inline` | `vertical` |
|
||||
| selectedKeys | 当前选中的菜单项 key 数组 | string[] | |
|
||||
| defaultSelectedKeys | 初始选中的菜单项 key 数组 | string[] | |
|
||||
| openKeys | 当前展开的 SubMenu 菜单项 key 数组 | string[] | |
|
||||
| defaultOpenKeys | 初始展开的 SubMenu 菜单项 key 数组 | | |
|
||||
| onOpenChange | SubMenu 展开/关闭的回调 | Function(openKeys: string[]) | noop |
|
||||
| onSelect | 被选中时调 | Function({ item, key, selectedKeys }) | 无 |
|
||||
| onDeselect | 取消选中时调用,仅在 multiple 生效 | Function({ item, key, selectedKeys }) | - |
|
||||
| onClick | 点击 menuitem 调用此函数,参数为 {item, key, keyPath} | function | - |
|
||||
| style | 根节点样式 | Object | |
|
||||
| style | 根节点样式 | object | |
|
||||
| inlineIndent | inline 模式的菜单缩进宽度 | number | 24 |
|
||||
|
||||
> More options in [rc-menu](https://github.com/react-component/menu#api)
|
||||
@ -48,24 +48,24 @@ subtitle: 导航菜单
|
||||
|
||||
| 参数 | 说明 | 类型 | 默认值 |
|
||||
|----------|----------------|----------|--------------|
|
||||
| disabled | 是否禁用 | Boolean | false |
|
||||
| key | item 的唯一标志 | String | |
|
||||
| disabled | 是否禁用 | boolean | false |
|
||||
| key | item 的唯一标志 | string | |
|
||||
|
||||
### Menu.SubMenu props
|
||||
|
||||
| 参数 | 说明 | 类型 | 默认值 |
|
||||
|----------|----------------|----------|--------------|
|
||||
| disabled | 是否禁用 | Boolean | false |
|
||||
| key | 唯一标志 | String | |
|
||||
| title | 子菜单项值 | String or React.Element | |
|
||||
| children | 子菜单的菜单项 | (MenuItem or SubMenu)[] | |
|
||||
| disabled | 是否禁用 | boolean | false |
|
||||
| key | 唯一标志 | string | |
|
||||
| title | 子菜单项值 | string\|ReactNode | |
|
||||
| children | 子菜单的菜单项 | Array<MenuItem\|SubMenu> | |
|
||||
| onTitleClick | 点击子菜单标题 | Function({ eventKey, domEvent }) | |
|
||||
|
||||
### Menu.ItemGroup props
|
||||
|
||||
| 参数 | 说明 | 类型 | 默认值 |
|
||||
|----------|----------------|----------|--------------|
|
||||
| title | 分组标题 | String or React.Element | |
|
||||
| title | 分组标题 | string\|ReactNode | |
|
||||
| children | 分组的菜单项 | MenuItem[] | |
|
||||
|
||||
### Menu.Divider
|
||||
|
@ -25,7 +25,7 @@ This components provides 4 static methods, with arguments as following:
|
||||
|
||||
| Argument | Description | Type | Default |
|
||||
|------------|------------------------------------|--------------------------|--------------|
|
||||
| content | content of the message | React.Element or String | - |
|
||||
| content | content of the message | string\|ReactNode | - |
|
||||
| duration | time before auto-dismiss,in seconds | number | 1.5 |
|
||||
|
||||
Methods for global configuration and destruction are also provided:
|
||||
@ -42,5 +42,5 @@ message.config({
|
||||
|
||||
| Argument | Description | Type | Default |
|
||||
|------------|------------------------------------|--------------------------|-------------|
|
||||
| top | distance to top | Number | 24px |
|
||||
| duration | time before auto-dismiss,in seconds | Number | 1.5 |
|
||||
| top | distance to top | number | 24px |
|
||||
| duration | time before auto-dismiss,in seconds | number | 1.5 |
|
||||
|
@ -26,7 +26,7 @@ title: Message
|
||||
|
||||
| 参数 | 说明 | 类型 | 默认值 |
|
||||
|------------|----------------|--------------------------|--------------|
|
||||
| content | 提示内容 | React.Element or String | - |
|
||||
| content | 提示内容 | string\|ReactNode | - |
|
||||
| duration | 自动关闭的延时,单位秒 | number | 1.5 |
|
||||
|
||||
还提供了全局配置和全局销毁方法:
|
||||
@ -43,5 +43,5 @@ message.config({
|
||||
|
||||
| 参数 | 说明 | 类型 | 默认值 |
|
||||
|------------|--------------------|--------------------------|-------------|
|
||||
| top | 消息距离顶部的位置 | Number | 24px |
|
||||
| duration | 默认自动关闭延时,单位秒 | Number | 1.5 |
|
||||
| top | 消息距离顶部的位置 | number | 24px |
|
||||
| duration | 默认自动关闭延时,单位秒 | number | 1.5 |
|
||||
|
@ -18,19 +18,19 @@ and so on.
|
||||
|
||||
| Property | Description | Type | Default |
|
||||
|------------|----------------|------------------|--------------|
|
||||
| visible | Determine whether a modal dialog is visible or not | Boolean | no |
|
||||
| confirmLoading | Determine whether to apply loading visual effect for OK button or not | Boolean | no |
|
||||
| title | The modal dialog's title | React.Element | no |
|
||||
| closable | Determine whether a close (x) button is visible on top right of the modal dialog or not | Boolean | true |
|
||||
| visible | Determine whether a modal dialog is visible or not | boolean | no |
|
||||
| confirmLoading | Determine whether to apply loading visual effect for OK button or not | boolean | no |
|
||||
| title | The modal dialog's title | string\|ReactNode | no |
|
||||
| closable | Determine whether a close (x) button is visible on top right of the modal dialog or not | boolean | true |
|
||||
| onOk | Specify a function that will be called when a user clicked OK button | function | no |
|
||||
| onCancel | Specify a function that will be called when a user clicked mask, close button on top right or cancel button | function(e) | no |
|
||||
| width | Width of a modal dialog | String or Number | 520 |
|
||||
| footer | Footer content | React.Element | OK and cancel button |
|
||||
| okText | Text of the OK button | String | OK |
|
||||
| cancelText | Text of the Cancel button | String | Cancel |
|
||||
| maskClosable | Determine whether to close the modal dialog when clicked mask of it. | Boolean | true |
|
||||
| style | Style of floating layer, typically used at least for adjusting the position. | Object | - |
|
||||
| wrapClassName | The class name of the container of the modal dialog | String | - |
|
||||
| width | Width of a modal dialog | string\|number | 520 |
|
||||
| footer | Footer content | string\|ReactNode | OK and cancel button |
|
||||
| okText | Text of the OK button | string | OK |
|
||||
| cancelText | Text of the Cancel button | string | Cancel |
|
||||
| maskClosable | Determine whether to close the modal dialog when clicked mask of it. | boolean | true |
|
||||
| style | Style of floating layer, typically used at least for adjusting the position. | object | - |
|
||||
| wrapClassName | The class name of the container of the modal dialog | string | - |
|
||||
| afterClose | Specify a function that will be called when modal is closed completely. | function | - |
|
||||
|
||||
#### Destroy on close
|
||||
@ -57,14 +57,14 @@ The properties of the object are follows:
|
||||
|
||||
| Property | Description | Type | Default |
|
||||
|------------|----------------|------------------|---------------|
|
||||
| title | Title | React.Element or String | no |
|
||||
| content | Content | React.Element or String | no |
|
||||
| title | Title | string\|ReactNode | no |
|
||||
| content | Content | string\|ReactNode | no |
|
||||
| onOk | Specify a function that will be called when a user clicked 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 | no |
|
||||
| onCancel | Specify a function that will be called when a user clicked 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 | no |
|
||||
| width | Width of dialog | String or Number | 416 |
|
||||
| iconType | Type of Icon component | String | question-circle |
|
||||
| okText | Text of OK button | String | OK |
|
||||
| cancelText | Text of cancel button | String | Cancel |
|
||||
| width | Width of dialog | string\|number | 416 |
|
||||
| iconType | Type of Icon component | string | question-circle |
|
||||
| okText | Text of OK button | string | OK |
|
||||
| cancelText | Text of cancel button | string | Cancel |
|
||||
|
||||
<style>
|
||||
.code-box-demo .ant-btn {
|
||||
|
@ -17,19 +17,19 @@ title: Modal
|
||||
|
||||
| 参数 | 说明 | 类型 | 默认值 |
|
||||
|------------|----------------|------------------|--------------|
|
||||
| visible | 对话框是否可见 | Boolean | 无 |
|
||||
| confirmLoading | 确定按钮 loading | Boolean | 无 |
|
||||
| title | 标题 | React.Element | 无 |
|
||||
| closable | 是否显示右上角的关闭按钮 | Boolean | true |
|
||||
| visible | 对话框是否可见 | boolean | 无 |
|
||||
| confirmLoading | 确定按钮 loading | boolean | 无 |
|
||||
| title | 标题 | string\|ReactNode | 无 |
|
||||
| closable | 是否显示右上角的关闭按钮 | boolean | true |
|
||||
| onOk | 点击确定回调 | function | 无 |
|
||||
| onCancel | 点击遮罩层或右上角叉或取消按钮的回调 | function(e) | 无 |
|
||||
| width | 宽度 | String or Number | 520 |
|
||||
| footer | 底部内容 | React.Element | 确定取消按钮 |
|
||||
| okText | 确认按钮文字 | String | 确定 |
|
||||
| cancelText | 取消按钮文字 | String | 取消 |
|
||||
| maskClosable | 点击蒙层是否允许关闭 | Boolean | true |
|
||||
| style | 可用于设置浮层的样式,调整浮层位置等 | Object | - |
|
||||
| wrapClassName | 对话框外层容器的类名 | String | - |
|
||||
| width | 宽度 | string\|number | 520 |
|
||||
| footer | 底部内容 | string\|ReactNode | 确定取消按钮 |
|
||||
| okText | 确认按钮文字 | string | 确定 |
|
||||
| cancelText | 取消按钮文字 | string | 取消 |
|
||||
| maskClosable | 点击蒙层是否允许关闭 | boolean | true |
|
||||
| style | 可用于设置浮层的样式,调整浮层位置等 | object | - |
|
||||
| wrapClassName | 对话框外层容器的类名 | string | - |
|
||||
| afterClose | Modal 完全关闭后的回调 | function | 无 |
|
||||
|
||||
#### 清空旧数据
|
||||
@ -55,14 +55,14 @@ title: Modal
|
||||
|
||||
| 参数 | 说明 | 类型 | 默认值 |
|
||||
|------------|----------------|------------------|--------------|
|
||||
| title | 标题 | React.Element or String | 无 |
|
||||
| content | 内容 | React.Element or String | 无 |
|
||||
| title | 标题 | string\|ReactNode | 无 |
|
||||
| content | 内容 | string\|ReactNode | 无 |
|
||||
| onOk | 点击确定回调,参数为关闭函数,返回 promise 时 resolve 后自动关闭 | function | 无 |
|
||||
| onCancel | 取消回调,参数为关闭函数,返回 promise 时 resolve 后自动关闭 | function | 无 |
|
||||
| width | 宽度 | String or Number | 416 |
|
||||
| iconType | 图标 Icon 类型 | String | question-circle |
|
||||
| okText | 确认按钮文字 | String | 确定 |
|
||||
| cancelText | 取消按钮文字 | String | 取消 |
|
||||
| width | 宽度 | string\|number | 416 |
|
||||
| iconType | 图标 Icon 类型 | string | question-circle |
|
||||
| okText | 确认按钮文字 | string | 确定 |
|
||||
| cancelText | 取消按钮文字 | string | 取消 |
|
||||
|
||||
<style>
|
||||
.code-box-demo .ant-btn {
|
||||
|
@ -30,13 +30,13 @@ The properties of config are as follows:
|
||||
|
||||
| Property | Description | Type | Default |
|
||||
|----------- |--------------------------------------------- | ----------- |--------|
|
||||
| message | The title of notification box (required) | React.Node | - |
|
||||
| description | The content of notification box (required) | React.Node | - |
|
||||
| btn | Customized close button | React.Node | - |
|
||||
| icon | Customized icon | React.Node | _ |
|
||||
| key | The unique identifier of current notification | String | - |
|
||||
| message | The title of notification box (required) | string\|ReactNode | - |
|
||||
| description | The content of notification box (required) | string\|ReactNode | - |
|
||||
| btn | Customized close button | ReactNode | - |
|
||||
| icon | Customized icon | ReactNode | _ |
|
||||
| key | The unique identifier of current notification | string | - |
|
||||
| onClose | Specify a function that will be called after clicking the default close button | Function | - |
|
||||
| duration | A notification box is closed after 4.5s by default. When specifying `duration` to null or 0, it will never be closed automatically | Number | 4.5 |
|
||||
| duration | A notification box is closed after 4.5s by default. When specifying `duration` to null or 0, it will never be closed automatically | number | 4.5 |
|
||||
|
||||
|
||||
`notification` also provide a global `config()` method that can be used for specifying the default options. Once this method is used, all the notification boxes
|
||||
@ -53,5 +53,5 @@ notification.config({
|
||||
|
||||
| Property | Description | Type | Default |
|
||||
|------------|--------------------|----------------------------|--------------|
|
||||
| top | Offset to top of message | Number | 24px |
|
||||
| duration | A duration to close notification automatically by default (unit: second) | Number | 4.5 |
|
||||
| top | Offset to top of message | number | 24px |
|
||||
| duration | A duration to close notification automatically by default (unit: second) | number | 4.5 |
|
||||
|
@ -7,8 +7,8 @@ let notificationInstance;
|
||||
let defaultDuration = 4.5;
|
||||
|
||||
export interface ArgsProps {
|
||||
message: React.ReactNode | string;
|
||||
description: React.ReactNode | string;
|
||||
message: React.ReactNode;
|
||||
description: React.ReactNode;
|
||||
btn?: React.ReactNode;
|
||||
key?: string;
|
||||
onClose?: () => void;
|
||||
|
@ -30,13 +30,13 @@ config 参数如下:
|
||||
|
||||
| 参数 | 说明 | 类型 | 默认值 |
|
||||
|----------- |--------------------------------------------- | ----------- |--------|
|
||||
| message | 通知提醒标题,必选 | React.Node | - |
|
||||
| description | 通知提醒内容,必选 | React.Node | - |
|
||||
| btn | 自定义关闭按钮 | React.Node | - |
|
||||
| icon | 自定义图标 | React.Node | - |
|
||||
| key | 当前通知唯一标志 | String | - |
|
||||
| message | 通知提醒标题,必选 | string\|ReactNode | - |
|
||||
| description | 通知提醒内容,必选 | string\|ReactNode | - |
|
||||
| btn | 自定义关闭按钮 | ReactNode | - |
|
||||
| icon | 自定义图标 | ReactNode | - |
|
||||
| key | 当前通知唯一标志 | string | - |
|
||||
| onClose | 点击默认关闭按钮时触发的回调函数 | Function | - |
|
||||
| duration | 默认 4.5 秒后自动关闭,配置为 null 则不自动关闭 | Number | 4.5 |
|
||||
| duration | 默认 4.5 秒后自动关闭,配置为 null 则不自动关闭 | number | 4.5 |
|
||||
|
||||
还提供了一个全局配置方法,在调用前提前配置,全局一次生效。
|
||||
|
||||
@ -51,5 +51,5 @@ notification.config({
|
||||
|
||||
| 参数 | 说明 | 类型 | 默认值 |
|
||||
|------------|--------------------|----------------------------|--------------|
|
||||
| top | 消息距离顶部的位置 | Number | 24px |
|
||||
| duration | 默认自动关闭延时,单位秒 | Number | 4.5 |
|
||||
| top | 消息距离顶部的位置 | number | 24px |
|
||||
| duration | 默认自动关闭延时,单位秒 | number | 4.5 |
|
||||
|
@ -19,16 +19,16 @@ A long list can be divided into several pages by `Pagination`, and only one page
|
||||
|
||||
Property | Description | Type | Default
|
||||
-----|-----|-----|------
|
||||
current | current page number | Number | -
|
||||
defaultCurrent | default current page number | Number | 1
|
||||
total | total number of data | Number | 0
|
||||
defaultPageSize | default number of data per page | Number | 10
|
||||
pageSize | number of data per page | Number | -
|
||||
current | current page number | number | -
|
||||
defaultCurrent | default current page number | number | 1
|
||||
total | total number of data | number | 0
|
||||
defaultPageSize | default number of data per page | number | 10
|
||||
pageSize | number of data per page | number | -
|
||||
onChange | a callback function, can be executed when the page number is changing, and it takes the resulting page number as an argument | Function(page) | noop
|
||||
showSizeChanger | determine whether `pageSize` can be changed | Boolean | false
|
||||
pageSizeOptions | specify the sizeChanger selections | Array | ['10', '20', '30', '40']
|
||||
showSizeChanger | determine whether `pageSize` can be changed | boolean | false
|
||||
pageSizeOptions | specify the sizeChanger selections | string[] | ['10', '20', '30', '40']
|
||||
onShowSizeChange | a callback function, can be executed when `pageSize` is changing | Function(current, size) | noop
|
||||
showQuickJumper | determine whether you can jump to a page directly | Boolean | false
|
||||
size | specify the size of `Pagination`, can be set to `small` | String | ""
|
||||
simple | whether to use simple mode | Object | -
|
||||
showQuickJumper | determine whether you can jump to a page directly | boolean | false
|
||||
size | specify the size of `Pagination`, can be set to `small` | string | ""
|
||||
simple | whether to use simple mode | object | -
|
||||
showTotal | to display the total number and range | Function(total, range) | -
|
||||
|
@ -20,16 +20,16 @@ title: Pagination
|
||||
|
||||
| 参数 | 说明 | 类型 | 默认值 |
|
||||
|------------------|------------------------------------|---------------|--------------------------|
|
||||
| current | 当前页数 | Number | - |
|
||||
| defaultCurrent | 默认的当前页数 | Number | 1 |
|
||||
| total | 数据总数 | Number | 0 |
|
||||
| defaultPageSize | 默认的每页条数 | Number | 10 |
|
||||
| pageSize | 每页条数 | Number | - |
|
||||
| current | 当前页数 | number | - |
|
||||
| defaultCurrent | 默认的当前页数 | number | 1 |
|
||||
| total | 数据总数 | number | 0 |
|
||||
| defaultPageSize | 默认的每页条数 | number | 10 |
|
||||
| pageSize | 每页条数 | number | - |
|
||||
| onChange | 页码改变的回调,参数是改变后的页码 | Function(page) | noop |
|
||||
| showSizeChanger | 是否可以改变 pageSize | Boolean | false |
|
||||
| pageSizeOptions | 指定每页可以显示多少条 | Array<String> | ['10', '20', '30', '40'] |
|
||||
| showSizeChanger | 是否可以改变 pageSize | boolean | false |
|
||||
| pageSizeOptions | 指定每页可以显示多少条 | string[] | ['10', '20', '30', '40'] |
|
||||
| onShowSizeChange | pageSize 变化的回调 | Function(current, size) | noop |
|
||||
| showQuickJumper | 是否可以快速跳转至某页 | Boolean | false |
|
||||
| size | 当为「small」时,是小尺寸分页 | String | "" |
|
||||
| simple | 当添加该属性时,显示为简单分页 | Object | - |
|
||||
| showQuickJumper | 是否可以快速跳转至某页 | boolean | false |
|
||||
| size | 当为「small」时,是小尺寸分页 | string | "" |
|
||||
| simple | 当添加该属性时,显示为简单分页 | object | - |
|
||||
| showTotal | 用于显示数据总量和当前数据顺序 | Function(total, range) | - |
|
||||
|
@ -16,10 +16,10 @@ The difference with `confirm` is more lightweight than the static popped full-sc
|
||||
|
||||
| Param | Description | Type | Default value |
|
||||
|-----------|------------------------------------------|---------------|--------|
|
||||
| title | title of the confirmation box | React.Element | none |
|
||||
| title | title of the confirmation box | string\|ReactNode | none |
|
||||
| onConfirm | callback of confirmation | function | none |
|
||||
| onCancel | callback of cancel | function | none |
|
||||
| okText | text of the confirmation button | String | Confirm |
|
||||
| cancelText| text of the cancel button | String | Cancel |
|
||||
| okText | text of the confirmation button | string | Confirm |
|
||||
| cancelText| text of the cancel button | string | Cancel |
|
||||
|
||||
Consult [Tooltip's documentation](https://ant.design/components/tooltip/#API) to find more APIs.
|
||||
|
@ -17,10 +17,10 @@ title: Popconfirm
|
||||
|
||||
| 参数 | 说明 | 类型 | 默认值 |
|
||||
|-----------|------------------------------------------|---------------|--------|
|
||||
| title | 确认框的描述 | React.Element | 无 |
|
||||
| title | 确认框的描述 | string\|ReactNode | 无 |
|
||||
| onConfirm | 点击确认的回调 | function | 无 |
|
||||
| onCancel | 点击取消的回调 | function | 无 |
|
||||
| okText | 确认按钮文字 | String | 确定 |
|
||||
| cancelText| 取消按钮文字 | String | 取消 |
|
||||
| okText | 确认按钮文字 | string | 确定 |
|
||||
| cancelText| 取消按钮文字 | string | 取消 |
|
||||
|
||||
更多属性请参考 [Tooltip](/components/tooltip-cn/#API)。
|
||||
|
@ -16,7 +16,7 @@ Comparing with `Tooltip`, besides information `Popover` card can also provide ac
|
||||
|
||||
| Param | Description | Type | Default value |
|
||||
|-----------|------------------------------------------|---------------|--------|
|
||||
| title | title of the card | React.Element | none |
|
||||
| content | content of the card | React.Element | none |
|
||||
| title | title of the card | string\|ReactNode | none |
|
||||
| content | content of the card | string\|ReactNode | none |
|
||||
|
||||
Consult [Tooltip's documentation](https://ant.design/components/tooltip/#API) to find more APIs.
|
||||
|
@ -17,7 +17,7 @@ title: Popover
|
||||
|
||||
| 参数 | 说明 | 类型 | 默认值 |
|
||||
|-----------|------------------------------------------|---------------|--------|
|
||||
| title | 卡片标题 | React.Element | 无 |
|
||||
| content | 卡片内容 | React.Element | 无 |
|
||||
| title | 卡片标题 | string\|ReactNode | 无 |
|
||||
| content | 卡片内容 | string\|ReactNode | 无 |
|
||||
|
||||
更多属性请参考 [Tooltip](/components/tooltip-cn/#API)。
|
||||
|
@ -17,12 +17,12 @@ If it will take a long time to complete the operation, you can use `Progress` to
|
||||
|
||||
Property | Description | Type | Default
|
||||
-----|-----|-----|------
|
||||
type | to set the type, options: `line` `circle` | String | line
|
||||
percent | to set the completion percentage | Number | 0
|
||||
type | to set the type, options: `line` `circle` | string | line
|
||||
percent | to set the completion percentage | number | 0
|
||||
format | template function of the content | function(percent) | `percent => percent + '%'`
|
||||
status | to set the status of the progress, options: `success` `exception` `active` | String | -
|
||||
showInfo | determine whether to display the progress value and the status icon | Boolean | true
|
||||
strokeWidth `(type=line)` | to set the width of the progress bar, unit: `px` | Number | 10
|
||||
strokeWidth `(type=circle)` | to set the width of the circular progress bar, unit: percentage of the canvas width | Number | 6
|
||||
width `(type=circle)` | to set the canvas width of the circular progress bar, unit: `px` | Number | 132
|
||||
status | to set the status of the progress, options: `success` `exception` `active` | string | -
|
||||
showInfo | determine whether to display the progress value and the status icon | boolean | true
|
||||
strokeWidth `(type=line)` | to set the width of the progress bar, unit: `px` | number | 10
|
||||
strokeWidth `(type=circle)` | to set the width of the circular progress bar, unit: percentage of the canvas width | number | 6
|
||||
width `(type=circle)` | to set the canvas width of the circular progress bar, unit: `px` | number | 132
|
||||
|
||||
|
@ -19,11 +19,11 @@ title: Progress
|
||||
|
||||
| 属性 | 说明 | 类型 | 默认值 |
|
||||
|----------|---------------|----------|---------------|
|
||||
| type | 类型,可选 `line` `circle` | String | line |
|
||||
| percent | 百分比 | Number | 0 |
|
||||
| type | 类型,可选 `line` `circle` | string | line |
|
||||
| percent | 百分比 | number | 0 |
|
||||
| format | 内容的模板函数 | function(percent) | `percent => percent + '%'` |
|
||||
| status | 状态,可选:`success` `exception` `active` | String | - |
|
||||
| showInfo | 是否显示进度数值或状态图标 | Boolean | true |
|
||||
| strokeWidth `(type=line)` | 进度条线的宽度,单位 px | Number | 10 |
|
||||
| strokeWidth `(type=circle)` | 圆形进度条线的宽度,单位是进度条画布宽度的百分比 | Number | 6 |
|
||||
| width `(type=circle)` | 圆形进度条画布宽度,单位 px | Number | 132 |
|
||||
| status | 状态,可选:`success` `exception` `active` | string | - |
|
||||
| showInfo | 是否显示进度数值或状态图标 | boolean | true |
|
||||
| strokeWidth `(type=line)` | 进度条线的宽度,单位 px | number | 10 |
|
||||
| strokeWidth `(type=circle)` | 圆形进度条线的宽度,单位是进度条画布宽度的百分比 | number | 6 |
|
||||
| width `(type=circle)` | 圆形进度条画布宽度,单位 px | number | 132 |
|
||||
|
@ -17,8 +17,8 @@ Radio.
|
||||
|
||||
| Property | Description | Type | optional | Default |
|
||||
|----------------|------------------------------------------|------------|---------|--------|
|
||||
| checked | Specifies whether the radio is selected. | Boolean | false |
|
||||
| defaultChecked | Specifies the initial state: whether or not the radio is selected. | Boolean | false |
|
||||
| checked | Specifies whether the radio is selected. | boolean | | false |
|
||||
| defaultChecked | Specifies the initial state: whether or not the radio is selected. | boolean | | false |
|
||||
| value | According to value for comparison, to determine whether the selected | any | | none |
|
||||
|
||||
### RadioGroup
|
||||
@ -30,4 +30,4 @@ radio group,wrap a group of `Radio`。
|
||||
| onChange | The callback function that is triggered when the state changes. | Function(e:Event) | none | none |
|
||||
| value | Used for setting the currently selected value. | any | none | none |
|
||||
| defaultValue | Default selected value | any | none | none |
|
||||
| size | Size, only on radio style | String | `large` `default` `small` | `default` |
|
||||
| size | Size, only on radio style | string | `large` `default` `small` | `default` |
|
||||
|
@ -18,8 +18,8 @@ title: Radio
|
||||
|
||||
| 参数 | 说明 | 类型 | 可选值 | 默认值 |
|
||||
|----------------|------------------------------------------|------------|---------|--------|
|
||||
| checked | 指定当前是否选中 | Boolean | | false |
|
||||
| defaultChecked | 初始是否选中 | Boolean | | false |
|
||||
| checked | 指定当前是否选中 | boolean | | false |
|
||||
| defaultChecked | 初始是否选中 | boolean | | false |
|
||||
| value | 根据 value 进行比较,判断是否选中 | any | | 无 |
|
||||
|
||||
### RadioGroup
|
||||
@ -31,4 +31,4 @@ title: Radio
|
||||
| onChange | 选项变化时的回调函数 | Function(e:Event) | 无 | 无 |
|
||||
| value | 用于设置当前选中的值 | any | 无 | 无 |
|
||||
| defaultValue | 默认选中的值 | any | 无 | 无 |
|
||||
| size | 大小,只对按钮样式生效 | String | `large` `default` `small` | `default` |
|
||||
| size | 大小,只对按钮样式生效 | string | `large` `default` `small` | `default` |
|
||||
|
@ -15,9 +15,9 @@ Rate component.
|
||||
|
||||
| Property | Description | type | Default |
|
||||
|------------|----------------|-------------------|-------------|
|
||||
| count | star count | Number | 5 |
|
||||
| value | current value | Number | - |
|
||||
| defaultValue | default value | Number | 0 |
|
||||
| onChange | callback | Function(value: Number) | - |
|
||||
| allowHalf | whether to allow semi selection | Boolean | false |
|
||||
| disabled | read only, unable to interact | Boolean | false |
|
||||
| count | star count | number | 5 |
|
||||
| value | current value | number | - |
|
||||
| defaultValue | default value | number | 0 |
|
||||
| onChange | callback | Function(value: number) | - |
|
||||
| allowHalf | whether to allow semi selection | boolean | false |
|
||||
| disabled | read only, unable to interact | boolean | false |
|
||||
|
@ -16,9 +16,9 @@ title: Rate
|
||||
|
||||
| 属性 | 说明 | 类型 | 默认值 |
|
||||
|------------|----------------|-------------------|-------------|
|
||||
| count | star 总数 | Number | 5 |
|
||||
| value | 当前数,受控值 | Number | - |
|
||||
| defaultValue | 默认值 | Number | 0 |
|
||||
| onChange | 回调 | Function(value: Number) | - |
|
||||
| allowHalf | 是否允许半选 | Boolean | false |
|
||||
| disabled | 只读,无法进行交互 | Boolean | false |
|
||||
| count | star 总数 | number | 5 |
|
||||
| value | 当前数,受控值 | number | - |
|
||||
| defaultValue | 默认值 | number | 0 |
|
||||
| onChange | 回调 | Function(value: number) | - |
|
||||
| allowHalf | 是否允许半选 | boolean | false |
|
||||
| disabled | 只读,无法进行交互 | boolean | false |
|
||||
|
@ -23,8 +23,8 @@ A Selector similar to Select2.
|
||||
|
||||
| Property | Description | Type | Default |
|
||||
|----------|----------------|----------|--------------|
|
||||
| value | Current selected option. | string/Array<String> | - |
|
||||
| defaultValue | Initial selected option. | string/Array<String> | - |
|
||||
| value | Current selected option. | string\|string[] | - |
|
||||
| defaultValue | Initial selected option. | string\|string[] | - |
|
||||
| multiple | Allow multiple select. | boolean | false |
|
||||
| allowClear | Show clear button, working in single mode only. | 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 |
|
||||
@ -32,7 +32,7 @@ A Selector similar to Select2.
|
||||
| onSelect | Called when a option is selected, the params are option's value (or key) and option instance. | function(value, option) | - |
|
||||
| onDeselect | Called when a option is deselected, the params are option's value (or key) . only called for multiple or tags, effective in multiple or tags mode only. | function(value) | - |
|
||||
| onChange | Called when select an option or input value change, or value of input is changed in combobox mode | function(value, label) | - |
|
||||
| onSearch | Callback function that is fired when input changed. | function(value: String) | |
|
||||
| onSearch | Callback function that is fired when input changed. | function(value: string) | |
|
||||
| onBlur | Called when blur | function | - |
|
||||
| onFocus | Called when focus | function | - |
|
||||
| placeholder | Placeholder of select | string | - |
|
||||
@ -41,29 +41,29 @@ A Selector similar to Select2.
|
||||
| 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. | string | `children` |
|
||||
| combobox | Enable combobox mode(can not set multiple at the same time). | boolean | false |
|
||||
| size | Size of Select input. `large` `small` | String | default |
|
||||
| size | Size of Select input. `large` `small` | string | default |
|
||||
| showSearch | Whether show search input in single mode.| boolean | false |
|
||||
| disabled | Whether disabled select | boolean | false |
|
||||
| defaultActiveFirstOption | Whether active first option by default | boolean | true |
|
||||
| dropdownStyle | style of dropdown menu | object | - |
|
||||
| dropdownClassName | className of dropdown menu | 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](http://codepen.io/anon/pen/xVBOVQ?editors=001) | function(triggerNode) | () => document.body |
|
||||
| labelInValue | whether to embed label in value, turn the format of value from `string` to `{key: String, label: React.Node}` | boolean | false |
|
||||
| tokenSeparators | Separator used to tokenize on tag/multiple mode | string[]? | |
|
||||
| labelInValue | whether to embed label in value, turn the format of value from `string` to `{key: string, label: ReactNode}` | boolean | false |
|
||||
| tokenSeparators | Separator used to tokenize on tag/multiple mode | string[] | |
|
||||
|
||||
|
||||
### Option props
|
||||
|
||||
| Property | Description | Type | Default |
|
||||
|----------|----------------|----------|--------------|
|
||||
| disabled | Disable this option | Boolean | false |
|
||||
| value | default to filter with this 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 | - |
|
||||
| disabled | Disable this option | boolean | false |
|
||||
| value | default to filter with this 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 | - |
|
||||
|
||||
### OptGroup props
|
||||
|
||||
| Property | Description | Type | Default |
|
||||
|----------|----------------|----------|-----------------|
|
||||
| label | Group label | String/React.Element | - |
|
||||
| key | | String | - |
|
||||
| label | Group label | string\|React.Element | - |
|
||||
| key | | string | - |
|
||||
|
@ -24,8 +24,8 @@ title: Select
|
||||
|
||||
| 参数 | 说明 | 类型 | 默认值 |
|
||||
|----------|----------------|----------|--------------|
|
||||
| value | 指定当前选中的条目 | string/Array<String> | - |
|
||||
| defaultValue | 指定默认选中的条目 | string/Array<String> | - |
|
||||
| value | 指定当前选中的条目 | string\|string[] | - |
|
||||
| defaultValue | 指定默认选中的条目 | string\|string[] | - |
|
||||
| multiple | 支持多选 | boolean | false |
|
||||
| allowClear | 支持清除, 单选模式有效 | boolean | false |
|
||||
| filterOption | 是否根据输入项进行筛选。当其为一个函数时,会接收 `inputValue` `option` 两个参数,当 `option` 符合筛选条件时,应返回 `true`,反之则返回 `false`。 | boolean or function(inputValue, option) | true |
|
||||
@ -33,7 +33,7 @@ title: Select
|
||||
| onSelect | 被选中时调用,参数为选中项的 value (或 key) 值 | function(value, option) | - |
|
||||
| onDeselect | 取消选中时调用,参数为选中项的 value (或 key) 值,仅在 multiple 或 tags 模式下生效 | function(value) | - |
|
||||
| onChange | 选中 option,或 input 的 value 变化(combobox 模式下)时,调用此函数 | function(value) | - |
|
||||
| onSearch | 文本框值变化时回调 | function(value: String) | |
|
||||
| onSearch | 文本框值变化时回调 | function(value: string) | |
|
||||
| onBlur | 失去焦点的时回调 | function | - |
|
||||
| onFocus | 获得焦点时回调 | function | - |
|
||||
| placeholder | 选择框默认文字 | string | - |
|
||||
@ -42,28 +42,28 @@ title: Select
|
||||
| optionFilterProp | 搜索时过滤对应的 option 属性,如设置为 children 表示对内嵌内容进行搜索 | string | value |
|
||||
| optionLabelProp | 回填到选择框的 Option 的属性值,默认是 Option 的子元素。比如在子元素需要高亮效果时,此值可以设为 `value`。 | string | `children` (combobox 模式下为 `value`) |
|
||||
| combobox | 输入框自动提示模式 | boolean | false |
|
||||
| size | 选择框大小,可选 `large` `small` | String | default |
|
||||
| size | 选择框大小,可选 `large` `small` | string | default |
|
||||
| showSearch | 在选择框中显示搜索框 | boolean | false |
|
||||
| disabled | 是否禁用 | boolean | false |
|
||||
| defaultActiveFirstOption | 是否默认高亮第一个选项。 | boolean | true
|
||||
| dropdownStyle | 下拉菜单的 style 属性 | object | - |
|
||||
| dropdownClassName | 下拉菜单的 className 属性 | string | - |
|
||||
| getPopupContainer | 菜单渲染父节点。默认渲染到 body 上,如果你遇到菜单滚动定位问题,试试修改为滚动的区域,并相对其定位。[示例](http://codepen.io/anon/pen/xVBOVQ?editors=001) | Function(triggerNode) | () => document.body |
|
||||
| labelInValue | 是否把每个选项的 label 包装到 value 中,会把 Select 的 value 类型从 `string` 变为 `{key: String, label: React.Node}` 的格式 | boolean | false |
|
||||
| tokenSeparators | 在 tags 和 multiple 模式下自动分词的分隔符 | string[]? | |
|
||||
| labelInValue | 是否把每个选项的 label 包装到 value 中,会把 Select 的 value 类型从 `string` 变为 `{key: string, label: ReactNode}` 的格式 | boolean | false |
|
||||
| tokenSeparators | 在 tags 和 multiple 模式下自动分词的分隔符 | string[] | |
|
||||
|
||||
### Option props
|
||||
|
||||
| 参数 | 说明 | 类型 | 默认值 |
|
||||
|----------|----------------|----------|--------------|
|
||||
| disabled | 是否禁用 | Boolean | false |
|
||||
| value | 默认根据此属性值进行筛选 | String | - |
|
||||
| key | 和 value 含义一致。如果 React 需要你设置此项,此项值与 value 的值相同,然后可以省略 value 设置 | String | |
|
||||
| title | 选中该 Option 后,Select 的 title | String | - |
|
||||
| disabled | 是否禁用 | boolean | false |
|
||||
| value | 默认根据此属性值进行筛选 | string | - |
|
||||
| key | 和 value 含义一致。如果 React 需要你设置此项,此项值与 value 的值相同,然后可以省略 value 设置 | string | |
|
||||
| title | 选中该 Option 后,Select 的 title | string | - |
|
||||
|
||||
### OptGroup props
|
||||
|
||||
| 参数 | 说明 | 类型 | 默认值 |
|
||||
|----------|----------------|----------|-----------------|
|
||||
| label | 组名 | String/React.Element | 无 |
|
||||
| key | | String | - |
|
||||
| label | 组名 | string\|React.Element | 无 |
|
||||
| key | | string | - |
|
||||
|
@ -14,16 +14,16 @@ To input a value in a range.
|
||||
|
||||
| Property | Description | Type | Default |
|
||||
|------------|----------------|-------------|--------------|
|
||||
| range | dual thumb mode | Boolean | false
|
||||
| min | The minimum value the slider can slide to. | Number | 0
|
||||
| max | The maximum value the slider can slide to | Number | 100
|
||||
| step | The granularity the slider can step through values. Must greater than 0, and be divided by (max - min) . When `marks` no null, `step` can be `null`. | Number or null | 1
|
||||
| marks | Tick mark of Slider, type of key must be `Number`, and must in closed interval [min, max] ,each mark can declare its own style. | Object{} | Object{Number: String or React.Component} or Object{Number: { style, label}}
|
||||
| dots | Whether the thumb can drag over tick only. | Boolean | false
|
||||
| value | The value of slider. When `range` is `false`, use `Number`, otherwise, use `[Number, Number]` | Number or [Number, Number] |
|
||||
| defaultValue | The default value of slider. When `range` is `false`, use `Number`, otherwise, use `[Number, Number]` | Number or [Number, Number] | 0 or [0, 0]
|
||||
| included | Make effect when `marks` not null,`true` means containment and `false` means coordinative | Boolean | true
|
||||
| disabled | If true, the slider will not be interactable. | Boolean | false
|
||||
| range | dual thumb mode | boolean | false
|
||||
| min | The minimum value the slider can slide to. | number | 0
|
||||
| max | The maximum value the slider can slide to | number | 100
|
||||
| step | The granularity the slider can step through values. Must greater than 0, and be divided by (max - min) . When `marks` no null, `step` can be `null`. | number\|null | 1
|
||||
| marks | Tick mark of Slider, type of key must be `number`, and must in closed interval [min, max] ,each mark can declare its own style. | object | { number: string\|ReactNode } or { number: { style: object, label: string\|ReactNode } }
|
||||
| dots | Whether the thumb can drag over tick only. | boolean | false
|
||||
| value | The value of slider. When `range` is `false`, use `number`, otherwise, use `[number, number]` | number\|number[] |
|
||||
| defaultValue | The default value of slider. When `range` is `false`, use `number`, otherwise, use `[number, number]` | number\|number[] | 0 or [0, 0]
|
||||
| included | Make effect when `marks` not null,`true` means containment and `false` means coordinative | boolean | true
|
||||
| disabled | If true, the slider will not be interactable. | boolean | false
|
||||
| onChange | Callback function that is fired when the user changes the slider's value. | Function(value) | NOOP
|
||||
| onAfterChange | Fire when `onmouseup` is fired. | Function(value) | NOOP
|
||||
| tipFormatter | Slider will pass its value to `tipFormatter`, and display its value in Tooltip, and hide Tooltip when return value is null. | Function or null | IDENTITY
|
||||
| tipFormatter | Slider will pass its value to `tipFormatter`, and display its value in Tooltip, and hide Tooltip when return value is null. | Function\|null | IDENTITY
|
||||
|
@ -15,16 +15,16 @@ title: Slider
|
||||
|
||||
| 参数 | 说明 | 类型 | 默认值 |
|
||||
|------------|----------------|-------------|--------------|
|
||||
| range | 双滑块模式 | Boolean | false
|
||||
| min | 最小值 | Number | 0
|
||||
| max | 最大值 | Number | 100
|
||||
| step | 步长,取值必须大于 0,并且可被 (max - min) 整除。当 `marks` 不为空对象时,可以设置 `step` 为 `null`,此时 Slider 的可选值仅有 marks 标出来的部分。 | Number or null | 1
|
||||
| marks | 刻度标记,key 的类型必须为 `Number` 且取值在闭区间 [min, max] 内,每个标签可以单独设置样式 | Object{} | Object{Number: String or React.Component} or Object{Number: { style, label}}
|
||||
| dots | 是否只能拖拽到刻度上 | Boolean | false
|
||||
| value | 设置当前取值。当 `range` 为 `false` 时,使用 `Number`,否则用 `[Number, Number]` | Number or [Number, Number] |
|
||||
| defaultValue | 设置初始取值。当 `range` 为 `false` 时,使用 `Number`,否则用 `[Number, Number]` | Number or [Number, Number] | 0 or [0, 0]
|
||||
| included | `marks` 不为空对象时有效,值为 true 时表示值为包含关系,false 表示并列 | Boolean | true
|
||||
| disabled | 值为 `true` 时,滑块为禁用状态 | Boolean | false
|
||||
| range | 双滑块模式 | boolean | false
|
||||
| min | 最小值 | number | 0
|
||||
| max | 最大值 | number | 100
|
||||
| step | 步长,取值必须大于 0,并且可被 (max - min) 整除。当 `marks` 不为空对象时,可以设置 `step` 为 `null`,此时 Slider 的可选值仅有 marks 标出来的部分。 | number\|null | 1
|
||||
| marks | 刻度标记,key 的类型必须为 `number` 且取值在闭区间 [min, max] 内,每个标签可以单独设置样式 | object | { number: string\|ReactNode } or { number: { style: object, label: string\|ReactNode } }
|
||||
| dots | 是否只能拖拽到刻度上 | boolean | false
|
||||
| value | 设置当前取值。当 `range` 为 `false` 时,使用 `number`,否则用 `[number, number]` | number\|number[] |
|
||||
| defaultValue | 设置初始取值。当 `range` 为 `false` 时,使用 `number`,否则用 `[number, number]` | number\|number[] | 0 or [0, 0]
|
||||
| included | `marks` 不为空对象时有效,值为 true 时表示值为包含关系,false 表示并列 | boolean | true
|
||||
| disabled | 值为 `true` 时,滑块为禁用状态 | boolean | false
|
||||
| onChange | 当 Slider 的值发生改变时,会触发 onChange 事件,并把改变后的值作为参数传入。 | Function(value) | NOOP
|
||||
| onAfterChange | 与 `onmouseup` 触发时机一致,把当前值作为参数传入。 | Function(value) | NOOP
|
||||
| tipFormatter | Slider 会把当前值传给 `tipFormatter`,并在 Tooltip 中显示 `tipFormatter` 的返回值,若为 null,则隐藏 Tooltip。 | Function or null | IDENTITY
|
||||
| tipFormatter | Slider 会把当前值传给 `tipFormatter`,并在 Tooltip 中显示 `tipFormatter` 的返回值,若为 null,则隐藏 Tooltip。 | Function\|null | IDENTITY
|
||||
|
@ -5,7 +5,7 @@ cols: 1
|
||||
title: Steps
|
||||
---
|
||||
|
||||
`Steps` is a navigation bar that guides users through the steps of a task.
|
||||
`Steps` is a navigation bar that guides users through the steps of a task.
|
||||
|
||||
## When To Use
|
||||
|
||||
@ -27,10 +27,10 @@ The whole of the step bar.
|
||||
|
||||
Property | Description | Type | Default
|
||||
-----|-----|-----|------
|
||||
current | to set the current step, counting from 0. You can overwrite this state by using `status` of `Step` | Number | 0
|
||||
status | to specify the status of current step, can be set to one of the following values: `wait` `process` `finish` `error` | String | `process`
|
||||
size | to specify the size of the step bar, `default` and `small` are currently supported | String | `default`
|
||||
direction | to specify the direction of the step bar, `horizontal` and `vertical` are currently supported | String | horizontal
|
||||
current | to set the current step, counting from 0. You can overwrite this state by using `status` of `Step` | number | 0
|
||||
status | to specify the status of current step, can be set to one of the following values: `wait` `process` `finish` `error` | string | `process`
|
||||
size | to specify the size of the step bar, `default` and `small` are currently supported | string | `default`
|
||||
direction | to specify the direction of the step bar, `horizontal` and `vertical` are currently supported | string | horizontal
|
||||
|
||||
### Steps.Step
|
||||
|
||||
@ -38,7 +38,7 @@ A single step in the step bar.
|
||||
|
||||
Property | Description | Type | Default
|
||||
-----|-----|-----|------
|
||||
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 | React.ReactNode | -
|
||||
description | detail of the step, optional property | React.ReactNode | -
|
||||
icon | icon of the step, optional property | string or React.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
|
||||
title | title of the step | string\|ReactNode | -
|
||||
description | detail of the step, optional property | string\|ReactNode | -
|
||||
icon | icon of the step, optional property | string\|ReactNode | -
|
||||
|
@ -28,10 +28,10 @@ title: Steps
|
||||
|
||||
| 参数 | 说明 | 类型 | 默认值 |
|
||||
|----------|------------------------------------------|-------------|-------|
|
||||
| current | 指定当前步骤,从 0 开始记数。在子 Step 元素中,可以通过 `status` 属性覆盖状态 | Number | 0 |
|
||||
| status | 指定当前步骤的状态,可选 `wait` `process` `finish` `error` | String | process |
|
||||
| size | 指定大小,目前支持普通(`default`)和迷你(`small`)| String | default |
|
||||
| direction | 指定步骤条方向。目前支持水平(`horizontal`)和竖直(`vertical`)两种方向 | String | horizontal |
|
||||
| current | 指定当前步骤,从 0 开始记数。在子 Step 元素中,可以通过 `status` 属性覆盖状态 | number | 0 |
|
||||
| status | 指定当前步骤的状态,可选 `wait` `process` `finish` `error` | string | process |
|
||||
| size | 指定大小,目前支持普通(`default`)和迷你(`small`)| string | default |
|
||||
| direction | 指定步骤条方向。目前支持水平(`horizontal`)和竖直(`vertical`)两种方向 | string | horizontal |
|
||||
|
||||
### Steps.Step
|
||||
|
||||
@ -39,7 +39,7 @@ title: Steps
|
||||
|
||||
| 参数 | 说明 | 类型 | 默认值 |
|
||||
|----------|-----------------------------------------|------------|-------|
|
||||
| status | 指定状态。当不配置该属性时,会使用 Steps 的 `current` 来自动指定状态。可选:`wait` `process` `finish` `error` | String | wait |
|
||||
| title | 标题 | React.ReactNode | - |
|
||||
| description | 步骤的详情描述,可选 | React.ReactNode | - |
|
||||
| icon | 步骤图标的类型,可选 | string or React.ReactNode | - |
|
||||
| status | 指定状态。当不配置该属性时,会使用 Steps 的 `current` 来自动指定状态。可选:`wait` `process` `finish` `error` | string | wait |
|
||||
| title | 标题 | string\|ReactNode | - |
|
||||
| description | 步骤的详情描述,可选 | string\|ReactNode | - |
|
||||
| icon | 步骤图标的类型,可选 | string\|ReactNode | - |
|
||||
|
@ -18,9 +18,9 @@ Switching Selector.
|
||||
|
||||
Property | Description | Type | Default |
|
||||
-----|-----|-----|------|
|
||||
checked | determine whether the `Switch` is checked | Boolean | false |
|
||||
defaultChecked | to set the initial state | Boolean | false |
|
||||
checked | determine whether the `Switch` is checked | boolean | false |
|
||||
defaultChecked | to set the initial state | boolean | false |
|
||||
onChange | a callback function, can be executed when the checked state is changing | Function(checked:Boolean) | |
|
||||
checkedChildren | content to be shown when the state is checked | React Node | |
|
||||
unCheckedChildren | content to be shown when the state is unchecked | React Node | |
|
||||
size | the size of the `Switch`, options: `default` `small` | String | default |
|
||||
checkedChildren | content to be shown when the state is checked | string\|ReactNode | |
|
||||
unCheckedChildren | content to be shown when the state is unchecked | string\|ReactNode | |
|
||||
size | the size of the `Switch`, options: `default` `small` | string | default |
|
||||
|
@ -18,9 +18,9 @@ title: Switch
|
||||
|
||||
| 参数 | 说明 | 类型 |默认值 |
|
||||
|-----------|------------------------------------------|------------|--------|
|
||||
| checked | 指定当前是否选中 | Boolean | false |
|
||||
| defaultChecked | 初始是否选中 | Boolean | false |
|
||||
| checked | 指定当前是否选中 | boolean | false |
|
||||
| defaultChecked | 初始是否选中 | boolean | false |
|
||||
| onChange | 变化时回调函数 | Function(checked:Boolean) | |
|
||||
| checkedChildren | 选中时的内容 | React Node | |
|
||||
| unCheckedChildren | 非选中时的内容 | React Node | |
|
||||
| size | 开关大小,可选值:`default` `small` | String | default |
|
||||
| checkedChildren | 选中时的内容 | string\|ReactNode | |
|
||||
| unCheckedChildren | 非选中时的内容 | string\|ReactNode | |
|
||||
| size | 开关大小,可选值:`default` `small` | string | default |
|
||||
|
@ -52,29 +52,29 @@ const columns = [{
|
||||
|
||||
| Property | Description | Type | Default |
|
||||
|---------------|--------------------------|-----------------|--------------|
|
||||
| rowSelection | row selection [config](#rowSelection) | Object | null |
|
||||
| pagination | pagination [config](/components/pagination/), hide it via setting to `false` | Object | |
|
||||
| size | size of table: `default` or `small` | String | `default` |
|
||||
| dataSource | data record array to be rendered | Array | |
|
||||
| columns | columns of table | Array | - |
|
||||
| rowKey | get row's key, could be a string or function | String or Function(record):string | 'key' |
|
||||
| rowSelection | row selection [config](#rowSelection) | object | null |
|
||||
| pagination | pagination [config](/components/pagination/), hide it via setting to `false` | object | |
|
||||
| size | size of table: `default` or `small` | string | `default` |
|
||||
| dataSource | data record array to be rendered | any[] | |
|
||||
| columns | columns of table | [ColumnProps](https://git.io/vMMXC)[] | - |
|
||||
| rowKey | get row's key, could be a string or function | string\|Function(record):string | 'key' |
|
||||
| rowClassName | get row's className | Function(record, index):string | - |
|
||||
| expandedRowRender | expanded container render for each row | Function | - |
|
||||
| defaultExpandedRowKeys | initial expanded row keys | Array | - |
|
||||
| expandedRowKeys | current expanded rows keys | Array | - |
|
||||
| defaultExpandAllRows | expand all rows initially | Boolean | false |
|
||||
| defaultExpandedRowKeys | initial expanded row keys | string[] | - |
|
||||
| expandedRowKeys | current expanded rows keys | string[] | - |
|
||||
| defaultExpandAllRows | expand all rows initially | boolean | false |
|
||||
| onExpandedRowsChange | function to call when the expanded rows change | Function(expandedRows) | |
|
||||
| onExpand | function to call when click expand icon | Function(expanded, record) | |
|
||||
| onChange | callback that is called when pagination, filters, sorter is changed | Function(pagination, filters, sorter) | |
|
||||
| loading | loading status of table | Boolean | false |
|
||||
| locale | i18n text include filter, sort, empty text...etc | Object | filterConfirm: 'Ok' <br> filterReset: 'Reset' <br> emptyText: 'No Data' <br> [Default](https://github.com/ant-design/ant-design/issues/575#issuecomment-159169511) |
|
||||
| indentSize | index pixel size of tree data | Number | 15 |
|
||||
| loading | loading status of table | boolean | false |
|
||||
| locale | i18n text include filter, sort, empty text...etc | object | filterConfirm: 'Ok' <br> filterReset: 'Reset' <br> emptyText: 'No Data' <br> [Default](https://github.com/ant-design/ant-design/issues/575#issuecomment-159169511) |
|
||||
| indentSize | index pixel size of tree data | number | 15 |
|
||||
| onRowClick | callback that is called when click a row | Function(record, index) | - |
|
||||
| bordered | whether to show table border completely | Boolean | false |
|
||||
| showHeader | whether to show table header | Boolean | true |
|
||||
| bordered | whether to show table border completely | boolean | false |
|
||||
| showHeader | whether to show table header | boolean | true |
|
||||
| footer | table footer renderer | Function(currentPageData) | |
|
||||
| title | table title renderer | Function(currentPageData) | |
|
||||
| scroll | whether table can be scroll in x/y direction, `x` or `y` can be a number that indicated the width and height of table body | Object | - |
|
||||
| scroll | whether table can be scroll in x/y direction, `x` or `y` can be a number that indicated the width and height of table body | object | - |
|
||||
|
||||
### Column
|
||||
|
||||
@ -82,30 +82,30 @@ One of Property `columns` for descriping column, Column has the same API.
|
||||
|
||||
| Property | Description | Type | Default |
|
||||
|---------------|--------------------------|-----------------|--------------|
|
||||
| title | title of this column | String or React.Element | - |
|
||||
| key | key of this column | String | - |
|
||||
| dataIndex | display field of the data record, could be set like `a.b.c` | String | - |
|
||||
| title | title of this column | string\|ReactNode | - |
|
||||
| key | key of this column | string | - |
|
||||
| dataIndex | display field of the data record, could be set like `a.b.c` | string | - |
|
||||
| render | renderer of table cell, has three params: text, record and index of this row. The render value should be a ReactNode, or a object for [colSpan/rowSpan config](#demo-colspan-rowspan) | Function(text, record, index) {} | - |
|
||||
| filters | filter menu config | Array | - |
|
||||
| filters | filter menu config | object[] | - |
|
||||
| onFilter | callback that is called when when click confirm filter button | Function | - |
|
||||
| filterMultiple | whether to select multiple filtered item | Boolean | true |
|
||||
| filterDropdown | customized filter overlay | React.Element | - |
|
||||
| filterDropdownVisible | whether filterDropdown is visible | Boolean | - |
|
||||
| filterMultiple | whether to select multiple filtered item | boolean | true |
|
||||
| filterDropdown | customized filter overlay | ReactNode | - |
|
||||
| filterDropdownVisible | whether filterDropdown is visible | boolean | - |
|
||||
| onFilterDropdownVisibleChange | called when filterDropdownVisible is changed | function(visible) {} | - |
|
||||
| filteredValue | controlled filtered value | Array | - |
|
||||
| sorter | sort function for local sort. If you need sort buttons only, set it `true` | Function or Boolean | - |
|
||||
| colSpan | span of this column's title | Number | |
|
||||
| width | width of this column | String or Number | - |
|
||||
| className | className of this column | String | - |
|
||||
| fixed | set column to be fixed: `true`(same as left) `'left'` `'right'` | Boolean or String | false |
|
||||
| sortOrder | controlled sorted value: `'ascend'` `'descend'` `false` | Boolean or String | - |
|
||||
| filteredValue | controlled filtered value | string[] | - |
|
||||
| sorter | sort function for local sort. If you need sort buttons only, set it `true` | Function\|boolean | - |
|
||||
| colSpan | span of this column's title | number | |
|
||||
| width | width of this column | string\|number | - |
|
||||
| className | className of this column | string | - |
|
||||
| fixed | set column to be fixed: `true`(same as left) `'left'` `'right'` | boolean\|string | false |
|
||||
| sortOrder | controlled sorted value: `'ascend'` `'descend'` `false` | boolean\|string | - |
|
||||
| onCellClick | callback when click cell | Function(record, event) | - |
|
||||
|
||||
### ColumnGroup
|
||||
|
||||
| Property | Description | Type | Default |
|
||||
|---------------|--------------------------|-----------------|--------------|
|
||||
| title | title of the column group | String or React.Element | - |
|
||||
| title | title of the column group | string\|ReactNode | - |
|
||||
|
||||
### rowSelection
|
||||
|
||||
@ -113,8 +113,8 @@ Properties for selection.
|
||||
|
||||
| Property | Description | Type | Default |
|
||||
|---------------|--------------------------|-----------------|--------------|
|
||||
| type | `checkbox` or `radio` | String | `checkbox` |
|
||||
| selectedRowKeys | controlled selected row keys | Array | [] |
|
||||
| type | `checkbox` or `radio` | string | `checkbox` |
|
||||
| selectedRowKeys | controlled selected row keys | string[] | [] |
|
||||
| onChange | callback that is called when selected rows change | Function(selectedRowKeys, selectedRows) | - |
|
||||
| getCheckboxProps | get Checkbox or Radio props | Function(record) | - |
|
||||
| onSelect | callback that is called when select/deselect one row | Function(record, selected, selectedRows) | - |
|
||||
|
@ -53,29 +53,29 @@ const columns = [{
|
||||
|
||||
| 参数 | 说明 | 类型 | 默认值 |
|
||||
|---------------|--------------------------|-----------------|---------|
|
||||
| rowSelection | 列表项是否可选择,[配置项](#rowSelection) | Object | null |
|
||||
| pagination | 分页器,配置项参考 [pagination](/components/pagination/),设为 false 时不展示和进行分页 | Object | |
|
||||
| size | 正常或迷你类型,`default` or `small` | String | default |
|
||||
| dataSource | 数据数组 | Array | |
|
||||
| columns | 表格列的配置描述,具体项见下表 | Array | - |
|
||||
| rowKey | 表格行 key 的取值,可以是字符串或一个函数 | String or Function(record):string | 'key' |
|
||||
| rowSelection | 列表项是否可选择,[配置项](#rowSelection) | object | null |
|
||||
| pagination | 分页器,配置项参考 [pagination](/components/pagination/),设为 false 时不展示和进行分页 | object | |
|
||||
| size | 正常或迷你类型,`default` or `small` | string | default |
|
||||
| dataSource | 数据数组 | any[] | |
|
||||
| columns | 表格列的配置描述,具体项见下表 | [ColumnProps](https://git.io/vMMXC)[] | - |
|
||||
| rowKey | 表格行 key 的取值,可以是字符串或一个函数 | string\|Function(record):string | 'key' |
|
||||
| rowClassName | 表格行的类名 | Function(record, index):string | - |
|
||||
| expandedRowRender | 额外的展开行 | Function | - |
|
||||
| defaultExpandedRowKeys | 默认展开的行 | Array | - |
|
||||
| expandedRowKeys | 展开的行,控制属性 | Array | - |
|
||||
| defaultExpandAllRows | 初始时,是否展开所有行 | Boolean | false |
|
||||
| defaultExpandedRowKeys | 默认展开的行 | string[] | - |
|
||||
| expandedRowKeys | 展开的行,控制属性 | string[] | - |
|
||||
| defaultExpandAllRows | 初始时,是否展开所有行 | boolean | false |
|
||||
| onExpandedRowsChange | 展开的行变化时触发 | Function(expandedRows) | |
|
||||
| onExpand | 点击展开图标时触发 | Function(expanded, record) | |
|
||||
| onChange | 分页、排序、筛选变化时触发 | Function(pagination, filters, sorter) | |
|
||||
| loading | 页面是否加载中 | Boolean | false |
|
||||
| locale | 默认文案设置,目前包括排序、过滤、空数据文案 | Object | filterConfirm: '确定' <br> filterReset: '重置' <br> emptyText: '暂无数据' <br> [默认值](https://github.com/ant-design/ant-design/issues/575#issuecomment-159169511) |
|
||||
| indentSize | 展示树形数据时,每层缩进的宽度,以 px 为单位 | Number | 15 |
|
||||
| loading | 页面是否加载中 | boolean | false |
|
||||
| locale | 默认文案设置,目前包括排序、过滤、空数据文案 | object | filterConfirm: '确定' <br> filterReset: '重置' <br> emptyText: '暂无数据' <br> [默认值](https://github.com/ant-design/ant-design/issues/575#issuecomment-159169511) |
|
||||
| indentSize | 展示树形数据时,每层缩进的宽度,以 px 为单位 | number | 15 |
|
||||
| onRowClick | 处理行点击事件 | Function(record, index) | - |
|
||||
| bordered | 是否展示外边框和列边框 | Boolean | false |
|
||||
| showHeader | 是否显示表头 | Boolean | true |
|
||||
| bordered | 是否展示外边框和列边框 | boolean | false |
|
||||
| showHeader | 是否显示表头 | boolean | true |
|
||||
| footer | 表格尾部 | Function(currentPageData) | |
|
||||
| title | 表格标题 | Function(currentPageData) | |
|
||||
| scroll | 横向或纵向支持滚动,也可用于指定滚动区域的宽高度:`{{ x: true, y: 300 }}` | Object | - |
|
||||
| scroll | 横向或纵向支持滚动,也可用于指定滚动区域的宽高度:`{{ x: true, y: 300 }}` | object | - |
|
||||
|
||||
### Column
|
||||
|
||||
@ -83,30 +83,30 @@ const columns = [{
|
||||
|
||||
| 参数 | 说明 | 类型 | 默认值 |
|
||||
|-----------|----------------------------|-----------------|---------|
|
||||
| title | 列头显示文字 | String or React.Element | - |
|
||||
| key | React 需要的 key,建议设置 | String | - |
|
||||
| dataIndex | 列数据在数据项中对应的 key,支持 `a.b.c` 的嵌套写法 | String | - |
|
||||
| title | 列头显示文字 | string\|ReactNode | - |
|
||||
| key | React 需要的 key,建议设置 | string | - |
|
||||
| dataIndex | 列数据在数据项中对应的 key,支持 `a.b.c` 的嵌套写法 | string | - |
|
||||
| render | 生成复杂数据的渲染函数,参数分别为当前行的值,当前行数据,行索引,@return里面可以设置表格[行/列合并](#demo-colspan-rowspan) | Function(text, record, index) {} | - |
|
||||
| filters | 表头的筛选菜单项 | Array | - |
|
||||
| filters | 表头的筛选菜单项 | object[] | - |
|
||||
| onFilter | 本地模式下,确定筛选的运行函数 | Function | - |
|
||||
| filterMultiple | 是否多选 | Boolean | true |
|
||||
| filterDropdown | 可以自定义筛选菜单,此函数只负责渲染图层,需要自行编写各种交互 | React.Element | - |
|
||||
| filterDropdownVisible | 用于控制自定义筛选菜单是否可见 | Boolean | - |
|
||||
| filterMultiple | 是否多选 | boolean | true |
|
||||
| filterDropdown | 可以自定义筛选菜单,此函数只负责渲染图层,需要自行编写各种交互 | ReactNode | - |
|
||||
| filterDropdownVisible | 用于控制自定义筛选菜单是否可见 | boolean | - |
|
||||
| onFilterDropdownVisibleChange | 自定义筛选菜单可见变化时调用 | function(visible) {} | - |
|
||||
| filteredValue | 筛选的受控属性,外界可用此控制列的筛选状态,值为已筛选的 value 数组 | Array | - |
|
||||
| sorter | 排序函数,本地排序使用一个函数,需要服务端排序可设为 true | Function or Boolean | - |
|
||||
| colSpan | 表头列合并,设置为 0 时,不渲染 | Number | |
|
||||
| width | 列宽度 | String or Number | - |
|
||||
| className | 列的 className | String | - |
|
||||
| fixed | 列是否固定,可选 `true`(等效于 left) `'left'` `'right'` | Boolean or String | false |
|
||||
| sortOrder | 排序的受控属性,外界可用此控制列的排序,可设置为 `'ascend'` `'descend'` `false` | Boolean or String | - |
|
||||
| filteredValue | 筛选的受控属性,外界可用此控制列的筛选状态,值为已筛选的 value 数组 | string[] | - |
|
||||
| sorter | 排序函数,本地排序使用一个函数,需要服务端排序可设为 true | Function\|boolean | - |
|
||||
| colSpan | 表头列合并,设置为 0 时,不渲染 | number | |
|
||||
| width | 列宽度 | string\|number | - |
|
||||
| className | 列的 className | string | - |
|
||||
| fixed | 列是否固定,可选 `true`(等效于 left) `'left'` `'right'` | boolean\|string | false |
|
||||
| sortOrder | 排序的受控属性,外界可用此控制列的排序,可设置为 `'ascend'` `'descend'` `false` | boolean\|string | - |
|
||||
| onCellClick | 单元格点击回调 | Function(record, event) | - |
|
||||
|
||||
### ColumnGroup
|
||||
|
||||
| 参数 | 说明 | 类型 | 默认值 |
|
||||
|-----------|----------------------------|-----------------|---------|
|
||||
| title | 列头显示文字 | String or React.Element | - |
|
||||
| title | 列头显示文字 | string\|ReactNode | - |
|
||||
|
||||
### rowSelection
|
||||
|
||||
@ -114,8 +114,8 @@ const columns = [{
|
||||
|
||||
| 参数 | 说明 | 类型 | 默认值 |
|
||||
|------------------|--------------------------|-----------------|---------------------|---------|
|
||||
| type | 多选/单选,`checkbox` or `radio` | String | `checkbox` |
|
||||
| selectedRowKeys | 指定选中项的 key 数组,需要和 onChange 进行配合 | Array | [] |
|
||||
| type | 多选/单选,`checkbox` or `radio` | string | `checkbox` |
|
||||
| selectedRowKeys | 指定选中项的 key 数组,需要和 onChange 进行配合 | string[] | [] |
|
||||
| onChange | 选中项发生变化的时的回调 | Function(selectedRowKeys, selectedRows) | - |
|
||||
| getCheckboxProps | 选择框的默认属性配置 | Function(record) | - |
|
||||
| onSelect | 用户手动选择/取消选择某列的回调 | Function(record, selected, selectedRows) | - |
|
||||
|
@ -36,4 +36,4 @@ Ant Design has 3 types Tabs for different situation.
|
||||
| Property | Description | Type | Default |
|
||||
|--------------|-----------------------|----------|--------------|
|
||||
| key | TabPane's key | string | _ |
|
||||
| tab | Show text in TabPane's head | React.ReactNode | _ |
|
||||
| tab | Show text in TabPane's head | string\|ReactNode | _ |
|
||||
|
@ -40,4 +40,4 @@ Ant Design 依次提供了三级选项卡,分别用于不同的场景。
|
||||
| 参数 | 说明 | 类型 | 默认值 |
|
||||
|------|------------------|-------------------------|--------|
|
||||
| key | 对应 activeKey | string | 无 |
|
||||
| tab | 选项卡头显示文字 | React.ReactNode | 无 |
|
||||
| tab | 选项卡头显示文字 | string\|ReactNode | 无 |
|
||||
|
@ -28,7 +28,7 @@ import moment from 'moment';
|
||||
| placeholder | display when there's no value | string | "Select a time" |
|
||||
| onChange | a callback function, can be executed when the selected time is changing | function(time: moment, timeString: string): void | - |
|
||||
| format | to set the time format | string | "HH:mm:ss"、"HH:mm"、"mm:ss" |
|
||||
| disabled | determine whether the TimePicker is disabled | bool | false |
|
||||
| disabled | determine whether the TimePicker is disabled | boolean | false |
|
||||
| disabledHours | to specify the hours that cannot be selected | function() | - |
|
||||
| disabledMinutes | to specify the minutes that cannot be selected | function(selectedHour) | - |
|
||||
| disabledSeconds | to specify the seconds that cannot be selected | function(selectedHour, selectedMinute) | - |
|
||||
|
@ -29,7 +29,7 @@ import moment from 'moment';
|
||||
| placeholder | 没有值的时候显示的内容 | string | "请选择时间" |
|
||||
| onChange | 时间发生变化的回调 | function(time: moment, timeString: string): void | 无 |
|
||||
| format | 展示的时间格式 | string | "HH:mm:ss"、"HH:mm"、"mm:ss" |
|
||||
| disabled | 禁用全部操作 | bool | false |
|
||||
| disabled | 禁用全部操作 | boolean | false |
|
||||
| disabledHours | 禁止选择部分小时选项 | function() | 无 |
|
||||
| disabledMinutes | 禁止选择部分分钟选项 | function(selectedHour) | 无 |
|
||||
| disabledSeconds | 禁止选择部分秒选项 | function(selectedHour, selectedMinute) | 无 |
|
||||
|
@ -6,7 +6,7 @@ export interface TimelineProps {
|
||||
prefixCls?: string;
|
||||
className?: string;
|
||||
/** 指定最后一个幽灵节点是否存在或内容 */
|
||||
pending?: boolean | React.ReactNode;
|
||||
pending?: React.ReactNode;
|
||||
style?: React.CSSProperties;
|
||||
}
|
||||
|
||||
|
@ -28,7 +28,7 @@ Timeline
|
||||
|
||||
| Property | Description | Type | Default |
|
||||
|----------|----------------------------------------|------------|-------|
|
||||
| pending | to set the last ghost node's existence or its content | boolean or React.Element | false |
|
||||
| pending | to set the last ghost node's existence or its content | boolean\|string\|ReactNode | false |
|
||||
|
||||
### Timeline.Item
|
||||
|
||||
@ -37,4 +37,4 @@ Node of timeline
|
||||
| Property | Description | Type | Default |
|
||||
|----------|------------------------------------------|------------|-------|
|
||||
| color | to set the circle's color to `blue, red, green` or other custom colors | string | blue |
|
||||
| dot | custom timeline dot | React.Element | - |
|
||||
| dot | custom timeline dot | string\|ReactNode | - |
|
||||
|
@ -29,7 +29,7 @@ title: Timeline
|
||||
|
||||
| 参数 | 说明 | 类型 | 默认值 |
|
||||
|----------|----------------------------------------|------------|-------|
|
||||
| pending | 指定最后一个幽灵节点是否存在或内容 | boolean or React.Element | false |
|
||||
| pending | 指定最后一个幽灵节点是否存在或内容 | boolean\|string\|ReactNode | false |
|
||||
|
||||
### Timeline.Item
|
||||
|
||||
@ -38,4 +38,4 @@ title: Timeline
|
||||
| 参数 | 说明 | 类型 | 默认值 |
|
||||
|----------|------------------------------------------|------------|-------|
|
||||
| color | 指定圆圈颜色 `blue, red, green`,或自定义的色值 | string | blue |
|
||||
| dot | 自定义时间轴点 | React.Element | - |
|
||||
| dot | 自定义时间轴点 | string\|ReactNode | - |
|
||||
|
@ -25,7 +25,7 @@ The following APIs are shared by Tooltip, Popconfirm, Popover.
|
||||
|-----------|------------------------------------------|------------|--------|
|
||||
| placement | to set the position, which can be one of `top` `left` `right` `bottom` `topLeft` `topRight` `bottomLeft` `bottomRight` `leftTop` `leftBottom` `rightTop` `rightBottom` | string | top |
|
||||
| getPopupContainer | to set the container of the tip, while the default is to create a `div` element in `body`. Use `getTooltipContainer` if you are using `antd@<2.5.2` | Function(triggerNode) | () => document.body |
|
||||
| arrowPointAtCenter | whether arrow pointed at the center of target, supported after `antd@1.11+` | Boolean | `false` |
|
||||
| arrowPointAtCenter | whether arrow pointed at the center of target, supported after `antd@1.11+` | boolean | `false` |
|
||||
| visible | make the float card visible or not | boolean | false |
|
||||
| onVisibleChange | callback of the visible attribute changed | (visible) => void | none |
|
||||
| trigger | triggering mode: can be hover, focus, or click. | string | hover |
|
||||
|
@ -27,7 +27,7 @@ title: Tooltip
|
||||
|-----------|------------------------------------------|------------|--------|
|
||||
| placement | 气泡框位置,可选 `top` `left` `right` `bottom` `topLeft` `topRight` `bottomLeft` `bottomRight` `leftTop` `leftBottom` `rightTop` `rightBottom` | string | top |
|
||||
| getPopupContainer | 浮层渲染父节点,默认渲染到 body 上。`2.5.2` 之前请使用 `getTooltipContainer` | Function(triggerNode) | () => document.body |
|
||||
| arrowPointAtCenter | 箭头是否指向目标元素中心,`antd@1.11+` 支持 | Boolean | `false` |
|
||||
| arrowPointAtCenter | 箭头是否指向目标元素中心,`antd@1.11+` 支持 | boolean | `false` |
|
||||
| visible | 用于手动控制浮层显隐 | boolean | false |
|
||||
| onVisibleChange | 显示隐藏的回调 | (visible) => void | 无 |
|
||||
| trigger | 触发行为,可选 `hover/focus/click` | string | hover |
|
||||
|
@ -17,22 +17,22 @@ One or more elements can be selected from either column, one click on the proper
|
||||
|
||||
| Property | Description | Type | Default |
|
||||
|-----------|------------------------------------------|------------|--------|
|
||||
| dataSource | Used for setting the source data. The elements that are part of this array will be present the left column. Except the elements whose keys are included in `targetKeys` prop. | Array | [] |
|
||||
| dataSource | Used for setting the source data. The elements that are part of this array will be present the left column. Except the elements whose keys are included in `targetKeys` prop. | [TransferItem](https://git.io/vMM64)[] | [] |
|
||||
| render | The function to generate the item shown on a column. Based on an record (element of the dataSource array), this function should return a React element which is generated from that record. | Function(record) | |
|
||||
| targetKeys | A set of keys of elements that are listed on the right column. | string[] | [] |
|
||||
| selectedKeys | A set of keys of selected items. | string[] | [] |
|
||||
| onChange | A callback function that is executed when the transfer between columns is complete. | (targetKeys, direction, moveKeys): void | |
|
||||
| onSelectChange | A callback function which is executed when selected items are changed. | (sourceSelectedKeys, targetSelectedKeys): void | |
|
||||
| listStyle | A custom CSS style used for rendering the transfer columns. | Object | |
|
||||
| className | A custom CSS class. | String | ['', ''] |
|
||||
| titles | A set of titles that are sorted from left to right. | Array | - |
|
||||
| operations | A set of operations that are sorted from top to bottom. | Array | [] |
|
||||
| showSearch | If included, a search box is shown on each column. | Boolean | false |
|
||||
| listStyle | A custom CSS style used for rendering the transfer columns. | object | |
|
||||
| className | A custom CSS class. | string | ['', ''] |
|
||||
| titles | A set of titles that are sorted from left to right. | string[] | - |
|
||||
| operations | A set of operations that are sorted from top to bottom. | string[] | [] |
|
||||
| showSearch | If included, a search box is shown on each column. | boolean | false |
|
||||
| filterOption | A function to determine whether an item should show in search result list | (inputValue, option): boolean | |
|
||||
| searchPlaceholder | The hint text of the search box. | String | 'Search here' |
|
||||
| notFoundContent | Text to display when a column is empty. | React.ReactNode | 'The list is empty' |
|
||||
| footer | A function used for rendering the footer. | (props): React.ReactNode | |
|
||||
| lazy | property of [react-lazy-load](https://github.com/loktar00/react-lazy-load) for lazy rendering items | Object | `{ height: 32, offset: 32 }` |
|
||||
| searchPlaceholder | The hint text of the search box. | string | 'Search here' |
|
||||
| notFoundContent | Text to display when a column is empty. | string\|ReactNode | 'The list is empty' |
|
||||
| footer | A function used for rendering the footer. | (props): ReactNode | |
|
||||
| lazy | property of [react-lazy-load](https://github.com/loktar00/react-lazy-load) for lazy rendering items | object | `{ height: 32, offset: 32 }` |
|
||||
|
||||
## Warning
|
||||
|
||||
|
@ -19,22 +19,22 @@ title: Transfer
|
||||
|
||||
| 参数 | 说明 | 类型 | 默认值 |
|
||||
|-----------|------------------------------------------|------------|--------|
|
||||
| dataSource | 数据源,其中的数据将会被渲染到左边一栏中,`targetKeys` 中指定的除外。 | Array | [] |
|
||||
| render | 每行数据渲染函数,该函数的入参为 `dataSource` 中的项,返回值为 React element | Function(record) | |
|
||||
| dataSource | 数据源,其中的数据将会被渲染到左边一栏中,`targetKeys` 中指定的除外。 | [TransferItem](https://git.io/vMM64)[] | [] |
|
||||
| render | 每行数据渲染函数,该函数的入参为 `dataSource` 中的项,返回值为 ReactElement | Function(record) | |
|
||||
| targetKeys | 显示在右侧框数据的key集合 | string[] | [] |
|
||||
| selectedKeys | 设置哪些项应该被选中 | string[] | [] |
|
||||
| onChange | 选项在两栏之间转移时的回调函数 | (targetKeys, direction, moveKeys): void | |
|
||||
| onSelectChange | 选中项发生改变时的回调函数 | (sourceSelectedKeys, targetSelectedKeys): void | |
|
||||
| listStyle | 两个穿梭框的自定义样式 | Object | |
|
||||
| className | 自定义类 | String | |
|
||||
| titles | 标题集合,顺序从左至右 | Array | ['', ''] |
|
||||
| operations | 操作文案集合,顺序从上至下 | Array | [] |
|
||||
| showSearch | 是否显示搜索框 | Boolean | false |
|
||||
| listStyle | 两个穿梭框的自定义样式 | object | |
|
||||
| className | 自定义类 | string | |
|
||||
| titles | 标题集合,顺序从左至右 | string[] | ['', ''] |
|
||||
| operations | 操作文案集合,顺序从上至下 | string[] | [] |
|
||||
| showSearch | 是否显示搜索框 | boolean | false |
|
||||
| filterOption | 接收 `inputValue` `option` 两个参数,当 `option` 符合筛选条件时,应返回 `true`,反之则返回 `false`。| (inputValue, option): boolean | |
|
||||
| searchPlaceholder | 搜索框的默认值 | string | '请输入搜索内容' |
|
||||
| notFoundContent | 当列表为空时显示的内容 | React.ReactNode | '列表为空' |
|
||||
| footer | 底部渲染函数 | (props): React.ReactNode | |
|
||||
| lazy | Transfer 使用了 [react-lazy-load](https://github.com/loktar00/react-lazy-load) 优化性能,这里可以设置相关参数 | Object | `{ height: 32, offset: 32 }` |
|
||||
| notFoundContent | 当列表为空时显示的内容 | string\|ReactNode | '列表为空' |
|
||||
| footer | 底部渲染函数 | (props): ReactNode | |
|
||||
| lazy | Transfer 使用了 [react-lazy-load](https://github.com/loktar00/react-lazy-load) 优化性能,这里可以设置相关参数 | object | `{ height: 32, offset: 32 }` |
|
||||
|
||||
## 注意
|
||||
|
||||
|
@ -29,7 +29,7 @@ export interface TransferListProps {
|
||||
checkedKeys: string[];
|
||||
checkStatus?: boolean;
|
||||
position?: string;
|
||||
notFoundContent?: React.ReactNode | string;
|
||||
notFoundContent?: React.ReactNode;
|
||||
filterOption: (filterText: any, item: any) => boolean;
|
||||
lazy?: boolean | {};
|
||||
}
|
||||
|
@ -18,30 +18,30 @@ Any data whose entries are defined in a hierarchical manner is fit to use this c
|
||||
|
||||
Property | Description | Type | Default
|
||||
-----|-----|-----|------
|
||||
value | To set the current selected treeNode(s). | __Default:__ String/Array<String>. __With `labelInValue` set:__ { value: String, label: React.Node }/Array<{ value, label }>. __With `treeCheckStrictly` set(`halfChecked` is set to `false`):__ { value: String, label: React.Node, halfChecked }/Array<{ value, label, halfChecked }>. | -
|
||||
labelInValue | Determine whether to put `label` into `value`, the type of `value` as specified in the above | Boolean | false
|
||||
defaultValue | To set the initial selected treeNode(s). | String/Array<String> | -
|
||||
multiple | Support multiple or not, will be `true` when enable `treeCheckable`. | Boolean | false
|
||||
value | To set the current selected treeNode(s). | __Default:__ string\|string[]. __With `labelInValue` set:__ { value: string, label: ReactNode }/Array<{ value: string, label: ReactNode }>. __With `treeCheckStrictly` set(`halfChecked` is set to `false`):__ { value: string, label: ReactNode, halfChecked: string[] }/Array<{ value: string, label: ReactNode, halfChecked: string[] }>. | -
|
||||
labelInValue | Determine whether to put `label` into `value`, the type of `value` as specified in the above | boolean | false
|
||||
defaultValue | To set the initial selected treeNode(s). | string\|string[] | -
|
||||
multiple | Support multiple or not, will be `true` when enable `treeCheckable`. | boolean | false
|
||||
onSelect | A callback function, can be executed when you select a treeNode. | function(value, node, extra) | -
|
||||
onChange | A callback function, can be executed when selected treeNodes or input value change | function(value, label, extra) | -
|
||||
allowClear | Whether allow clear | Boolean | false
|
||||
onSearch | A callback function, can be executed when the search input changes. | function(value: String) | -
|
||||
placeholder | Placeholder of the select input | String | -
|
||||
searchPlaceholder | Placeholder of the search input | String | -
|
||||
dropdownStyle | To set the style of the dropdown menu | Object | -
|
||||
dropdownMatchSelectWidth | Determine whether the dropdown menu and the select input are the same width | Boolean | -
|
||||
size | To set the size of the select input, options: `large` `small` | String | default
|
||||
showSearch | Whether to display a search input in the dropdown menu(valid only in the single mode) | Boolean | false
|
||||
disabled | Disabled or not | Boolean | false
|
||||
allowClear | Whether allow clear | boolean | false
|
||||
onSearch | A callback function, can be executed when the search input changes. | function(value: string) | -
|
||||
placeholder | Placeholder of the select input | string | -
|
||||
searchPlaceholder | Placeholder of the search input | string | -
|
||||
dropdownStyle | To set the style of the dropdown menu | object | -
|
||||
dropdownMatchSelectWidth | Determine whether the dropdown menu and the select input are the same width | boolean | -
|
||||
size | To set the size of the select input, options: `large` `small` | string | default
|
||||
showSearch | Whether to display a search input in the dropdown menu(valid only in the single mode) | boolean | false
|
||||
disabled | Disabled or not | boolean | false
|
||||
showCheckedStrategy | __Default:__ just show child nodes. __`TreeSelect.SHOW_ALL`:__ show all checked treeNodes (include parent treeNode). __`TreeSelect.SHOW_PARENT`:__ show checked treeNodes (just show parent treeNode). | enum{TreeSelect.SHOW_ALL, TreeSelect.SHOW_PARENT, TreeSelect.SHOW_CHILD } | TreeSelect.SHOW_CHILD
|
||||
treeDefaultExpandAll | Whether to expand all treeNodes by default | Boolean | false
|
||||
treeCheckable | Whether to show checkbox on the treeNodes | Boolean | false
|
||||
treeCheckStrictly | Whether to check nodes precisely(in the `checkable` mode), means parent and child nodes are not associated | Boolean | false
|
||||
filterTreeNode | Whether to filter treeNodes by input value. The value of `treeNodeFilterProp` is used for filtering by default. | Boolean/Function(inputValue: string, treeNode: TreeNode) (should return Boolean) | Function
|
||||
treeNodeFilterProp | Will be used for filtering if `filterTreeNode` returns true | String | 'value'
|
||||
treeNodeLabelProp | Will render as content of select | String | 'title'
|
||||
treeDefaultExpandAll | Whether to expand all treeNodes by default | boolean | false
|
||||
treeCheckable | Whether to show checkbox on the treeNodes | boolean | false
|
||||
treeCheckStrictly | Whether to check nodes precisely(in the `checkable` mode), means parent and child nodes are not associated | boolean | false
|
||||
filterTreeNode | Whether to filter treeNodes by input value. The value of `treeNodeFilterProp` is used for filtering by default. | boolean\|Function(inputValue: string, treeNode: TreeNode) (should return boolean) | Function
|
||||
treeNodeFilterProp | Will be used for filtering if `filterTreeNode` returns true | string | 'value'
|
||||
treeNodeLabelProp | Will render as content of select | string | 'title'
|
||||
treeData | Data of the treeNodes, manual construction work is no longer needed if this property has been set(ensure the Uniqueness of each value) | array<{ value, label, children, [disabled, selectable] }> | []
|
||||
treeDataSimpleMode | Enable simple mode of treeData.(treeData should like this: [{id:1, pId:0, value:'1', label:"test1",...},...], pId is parent node's id) | Boolean/Object{ id: 'id', pId: 'pId', rootPId: null } | false
|
||||
treeDataSimpleMode | Enable simple mode of treeData.(treeData should like this: [{id:1, pId:0, value:'1', label:"test1",...},...], pId is parent node's id) | false\|Array<{ id: string, pId: string, rootPId: null }> | false
|
||||
loadData | Load data asynchronously. | function(node) | -
|
||||
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](http://codepen.io/anon/pen/xVBOVQ?editors=001) | Function(triggerNode) | () => document.body
|
||||
|
||||
@ -51,9 +51,9 @@ getPopupContainer | To set the container of the dropdown menu. The default is to
|
||||
|
||||
Property | Description | Type | Default
|
||||
-----|-----|-----|------
|
||||
disabled | Disabled or not | Boolean | false
|
||||
key | Required property, should be unique in the tree | String | -
|
||||
value | Will be treated as `treeNodeFilterProp` by default, should be unique in the tree | String | -
|
||||
title | Content showed on the treeNodes | String/element | '---'
|
||||
isLeaf | Leaf node or not | Boolean | false
|
||||
disabled | Disabled or not | boolean | false
|
||||
key | Required property, should be unique in the tree | string | -
|
||||
value | Will be treated as `treeNodeFilterProp` by default, should be unique in the tree | string | -
|
||||
title | Content showed on the treeNodes | string\|ReactNode | '---'
|
||||
isLeaf | Leaf node or not | boolean | false
|
||||
|
||||
|
@ -17,30 +17,30 @@ title: TreeSelect
|
||||
|
||||
| 参数 | 说明 | 类型 | 默认值 |
|
||||
|-----------|------------------------------------------|------------|--------|
|
||||
| value | 指定当前选中的条目 | 通常: String/Array<String>. 设置 labelInValue: {value: String, label: React.Node}/Array<{value, label}>. 设置 treeCheckStrictly(halfChecked 默认为 false): {value: String, label: React.Node, halfChecked}/Array<{value, label, halfChecked}>. | - |
|
||||
| labelInValue | 是否把 label 嵌入到 value 里,设置后参考以上 value 类型写法 | Boolean | false |
|
||||
| defaultValue | 指定默认选中的条目 | String/Array<String> | - |
|
||||
| multiple | 支持多选(当设置 treeCheckable 时自动变为true) | Boolean | false |
|
||||
| value | 指定当前选中的条目 | 通常: string/string[]. 设置 labelInValue: { value: string, label: ReactNode }/Array<{ value: string, label: ReactNode }>. 设置 treeCheckStrictly(halfChecked 默认为 false): { value: string, label: ReactNode, halfChecked: string[] }/Array<{ value: string, label: ReactNode, halfChecked: string[] }>. | - |
|
||||
| labelInValue | 是否把 label 嵌入到 value 里,设置后参考以上 value 类型写法 | boolean | false |
|
||||
| defaultValue | 指定默认选中的条目 | string/string[] | - |
|
||||
| multiple | 支持多选(当设置 treeCheckable 时自动变为true) | boolean | false |
|
||||
| onSelect | 被选中时调用 | function(value, node, extra) | - |
|
||||
| onChange | 选中树节点时调用此函数 | function(value, label, extra) | - |
|
||||
| allowClear | 显示清除按钮 | Boolean | false |
|
||||
| onSearch | 文本框值变化时回调 | function(value: String) | - |
|
||||
| placeholder | 选择框默认文字 | String | - |
|
||||
| searchPlaceholder | 搜索框默认文字 | String | - |
|
||||
| dropdownStyle | 下拉菜单的样式 | Object | - |
|
||||
| dropdownMatchSelectWidth | 下拉菜单和选择器同宽 | Boolean | true |
|
||||
| size | 选择框大小,可选 `large` `small` | String | default |
|
||||
| showSearch | 在下拉中显示搜索框(仅在单选模式下生效) | Boolean | false |
|
||||
| disabled | 是否禁用 | Boolean | false |
|
||||
| allowClear | 显示清除按钮 | boolean | false |
|
||||
| onSearch | 文本框值变化时回调 | function(value: string) | - |
|
||||
| placeholder | 选择框默认文字 | string | - |
|
||||
| searchPlaceholder | 搜索框默认文字 | string | - |
|
||||
| dropdownStyle | 下拉菜单的样式 | object | - |
|
||||
| dropdownMatchSelectWidth | 下拉菜单和选择器同宽 | boolean | true |
|
||||
| size | 选择框大小,可选 `large` `small` | string | default |
|
||||
| showSearch | 在下拉中显示搜索框(仅在单选模式下生效) | boolean | false |
|
||||
| disabled | 是否禁用 | boolean | false |
|
||||
| showCheckedStrategy | `TreeSelect.SHOW_ALL`: 显示所有选中节点(包括父节点). `TreeSelect.SHOW_PARENT`: 只显示父节点(当父节点下所有子节点都选中时). 默认只显示子节点. | enum{TreeSelect.SHOW_ALL, TreeSelect.SHOW_PARENT, TreeSelect.SHOW_CHILD } | TreeSelect.SHOW_CHILD |
|
||||
| treeDefaultExpandAll | 默认展开所有树节点 | Boolean | false |
|
||||
| treeCheckable | 显示 checkbox | Boolean | false |
|
||||
| treeCheckStrictly | checkable 状态下节点选择完全受控(父子节点选中状态不再关联)| Boolean | false |
|
||||
| filterTreeNode | 是否根据输入项进行筛选,默认用 treeNodeFilterProp 的值作为要筛选的 TreeNode 的属性值 | Boolean/Function(inputValue: string, treeNode: TreeNode) (函数需要返回bool值) | Function |
|
||||
| treeNodeFilterProp | 输入项过滤对应的 treeNode 属性 | String | 'value' |
|
||||
| treeNodeLabelProp | 作为显示的 prop 设置 | String | 'title' |
|
||||
| treeDefaultExpandAll | 默认展开所有树节点 | boolean | false |
|
||||
| treeCheckable | 显示 checkbox | boolean | false |
|
||||
| treeCheckStrictly | checkable 状态下节点选择完全受控(父子节点选中状态不再关联)| boolean | false |
|
||||
| filterTreeNode | 是否根据输入项进行筛选,默认用 treeNodeFilterProp 的值作为要筛选的 TreeNode 的属性值 | boolean\|Function(inputValue: string, treeNode: TreeNode) (函数需要返回bool值) | Function |
|
||||
| treeNodeFilterProp | 输入项过滤对应的 treeNode 属性 | string | 'value' |
|
||||
| treeNodeLabelProp | 作为显示的 prop 设置 | string | 'title' |
|
||||
| treeData | treeNodes 数据,如果设置则不需要手动构造 TreeNode 节点(value 在整个树范围内唯一)| array<{value, label, children, [disabled, selectable]}> | [] |
|
||||
|treeDataSimpleMode | 使用简单格式的 treeData,具体设置参考可设置的类型 (此时 treeData 应变为这样的数据结构: [{id:1, pId:0, value:'1', label:"test1",...},...], `pId` 是父节点的 id) | Boolean/Object{id: 'id', pId: 'pId', rootPId: null} | false |
|
||||
|treeDataSimpleMode | 使用简单格式的 treeData,具体设置参考可设置的类型 (此时 treeData 应变为这样的数据结构: [{id:1, pId:0, value:'1', label:"test1",...},...], `pId` 是父节点的 id) | false\|Array<{ id: string, pId: string, rootPId: null }> | false |
|
||||
| loadData | 异步加载数据 | function(node) | - |
|
||||
| getPopupContainer | 菜单渲染父节点。默认渲染到 body 上,如果你遇到菜单滚动定位问题,试试修改为滚动的区域,并相对其定位。[示例](http://codepen.io/anon/pen/xVBOVQ?editors=001) | Function(triggerNode) | () => document.body |
|
||||
|
||||
@ -50,8 +50,8 @@ title: TreeSelect
|
||||
|
||||
| 参数 | 说明 | 类型 | 默认值 |
|
||||
|-----------|------------------------------------------|------------|--------|
|
||||
| disabled | 是否禁用 | Boolean | false |
|
||||
| key | 此项必须设置(其值在整个树范围内唯一) | String | - |
|
||||
| value | 默认根据此属性值进行筛选(其值在整个树范围内唯一) | String | - |
|
||||
| title | 树节点显示的内容 | String/element | '---' |
|
||||
| isLeaf | 是否是叶子节点 | Boolean | false |
|
||||
| disabled | 是否禁用 | boolean | false |
|
||||
| key | 此项必须设置(其值在整个树范围内唯一) | string | - |
|
||||
| value | 默认根据此属性值进行筛选(其值在整个树范围内唯一) | string | - |
|
||||
| title | 树节点显示的内容 | string\|ReactNode | '---' |
|
||||
| isLeaf | 是否是叶子节点 | boolean | false |
|
||||
|
@ -14,24 +14,24 @@ Directory, organization, biological classification, country, and etc. Almost thi
|
||||
|
||||
| Property | Description | Type | Default |
|
||||
|----------------|--------------------------------------------------|------------|---------|
|
||||
|multiple | Whether allow to select multiple treeNodes | bool | false |
|
||||
|checkable | Whether support add Checkbox before treeNode | bool | false |
|
||||
|defaultExpandAll | Whether default to expand all treeNodes | bool | false |
|
||||
|defaultExpandedKeys | Specify keys of default expanded treeNodes | String[] | [] |
|
||||
|expandedKeys |(controlled) Specifies keys of expanded treeNodes | String[] | [] |
|
||||
|autoExpandParent | Whether to automatically expand a parent treeNode | bool | true |
|
||||
|defaultCheckedKeys | Specifies keys of default checked treeNodes | String[] | [] |
|
||||
|checkedKeys |(controlled) Specifies keys of checked treeNodes(PS: When specifies a key of treeNode which is a parent treeNode, all children treeNodes of its will be checked; And vice versa, when specifies a key of treeNode which is a child treeNode, its parent treeNode will also be checked. When `checkable` and `checkStrictly` is true, it'a object has `checked` and `halfChecked` property, and no matter child treeNode or parent treeNode is checked, they won't impact on eachother. | String[]/{checked:Array<String>,halfChecked:Array<String>} | [] |
|
||||
|checkStrictly| Check treeNode precisely, parent treeNode and children treeNodes are not associated | bool | false |
|
||||
|defaultSelectedKeys | Specifies keys of default selected treeNodes | String[] | [] |
|
||||
|selectedKeys |(controlled) Specifies keys of selected treeNode | String[] | - |
|
||||
|multiple | Whether allow to select multiple treeNodes | boolean | false |
|
||||
|checkable | Whether support add Checkbox before treeNode | boolean | false |
|
||||
|defaultExpandAll | Whether default to expand all treeNodes | boolean | false |
|
||||
|defaultExpandedKeys | Specify keys of default expanded treeNodes | string[] | [] |
|
||||
|expandedKeys |(controlled) Specifies keys of expanded treeNodes | string[] | [] |
|
||||
|autoExpandParent | Whether to automatically expand a parent treeNode | boolean | true |
|
||||
|defaultCheckedKeys | Specifies keys of default checked treeNodes | string[] | [] |
|
||||
|checkedKeys |(controlled) Specifies keys of checked treeNodes(PS: When specifies a key of treeNode which is a parent treeNode, all children treeNodes of its will be checked; And vice versa, when specifies a key of treeNode which is a child treeNode, its parent treeNode will also be checked. When `checkable` and `checkStrictly` is true, it'a object has `checked` and `halfChecked` property, and no matter child treeNode or parent treeNode is checked, they won't impact on eachother. | string[]/{checked:string[],halfChecked:string[]} | [] |
|
||||
|checkStrictly| Check treeNode precisely, parent treeNode and children treeNodes are not associated | boolean | false |
|
||||
|defaultSelectedKeys | Specifies keys of default selected treeNodes | string[] | [] |
|
||||
|selectedKeys |(controlled) Specifies keys of selected treeNode | string[] | - |
|
||||
|onExpand | Defines a function will be called when expand or collapse a treeNode | function(expandedKeys, {expanded: bool, node}) | - |
|
||||
|onCheck | Defines a function will be called when the onCheck event occurs | function(checkedKeys, e:{checked: bool, checkedNodes, node, event}) | - |
|
||||
|onSelect | The callback will be invoked when the user clicks a treeNode | function(selectedKeys, e:{selected: bool, selectedNodes, node, event}) | - |
|
||||
|filterTreeNode | Defines a function to filter treeNodes(highlight),when return true, corresponding treeNode will be highlight | function(node) | - |
|
||||
|loadData | load data asynchronously | function(node)| - |
|
||||
|onRightClick | The call back will be invoked when the user right clicks a treeNode | function({event,node}) | - |
|
||||
|draggable | Specifies whether this Tree is draggable(IE>8) | bool | false |
|
||||
|draggable | Specifies whether this Tree is draggable(IE>8) | boolean | false |
|
||||
|onDragStart | Defines a function will be called when the onDragStart event occurs | function({event,node}) | - |
|
||||
|onDragEnter | Defines a function will be called when the onDragEnter event occurs | function({event,node,expandedKeys}) | - |
|
||||
|onDragOver | Defines a function will be called when the onDragOver event occurs | function({event,node}) | - |
|
||||
@ -43,11 +43,11 @@ Directory, organization, biological classification, country, and etc. Almost thi
|
||||
|
||||
| Property | Description | Type | Default |
|
||||
|-----------|------------------------------------------|---------|---------|
|
||||
|disabled | whether disabled the treeNode | bool | false |
|
||||
|disableCheckbox | whether disable the checkbox of treeNode | bool | false |
|
||||
|title | title | String/element | '---' |
|
||||
|key | it's used with (default)ExpandedKeys / (default)CheckedKeys / (default)SelectedKeys. P.S.: it must be unique in all of treeNodes of the tree! | String | internal calculated position of treeNode |
|
||||
|isLeaf | whether it's leaf node | bool | false |
|
||||
|disabled | whether disabled the treeNode | boolean | false |
|
||||
|disableCheckbox | whether disable the checkbox of treeNode | boolean | false |
|
||||
|title | title | string\|ReactNode | '---' |
|
||||
|key | it's used with (default)ExpandedKeys / (default)CheckedKeys / (default)SelectedKeys. P.S.: it must be unique in all of treeNodes of the tree! | string | internal calculated position of treeNode |
|
||||
|isLeaf | whether it's leaf node | boolean | false |
|
||||
|
||||
## Note
|
||||
|
||||
|
@ -15,24 +15,24 @@ subtitle: 树形控件
|
||||
|
||||
| 参数 | 说明 | 类型 | 默认值 |
|
||||
|-----------|------------------------------------------|------------|--------|
|
||||
|multiple | 支持点选多个节点(节点本身) | bool | false |
|
||||
|checkable | 节点前添加 Checkbox 复选框 | bool | false |
|
||||
|defaultExpandAll | 默认展开所有树节点 | bool | false |
|
||||
|defaultExpandedKeys | 默认展开指定的树节点 | String[] | [] |
|
||||
|expandedKeys | (受控)展开指定的树节点 | String[] | [] |
|
||||
|autoExpandParent | 是否自动展开父节点 | bool | true |
|
||||
|defaultCheckedKeys | 默认选中复选框的树节点 | String[] | [] |
|
||||
|checkedKeys | (受控)选中复选框的树节点(注意:父子节点有关联,如果传入父节点key,则子节点自动选中;相应当子节点key都传入,父节点也自动选中。当设置`checkable`和`checkStrictly`,它是一个有`checked`和`halfChecked`属性的对象,并且父子节点的选中与否不再关联 | String[]/{checked:Array<String>,halfChecked:Array<String>} | [] |
|
||||
|checkStrictly| checkable状态下节点选择完全受控(父子节点选中状态不再关联)| bool | false |
|
||||
|defaultSelectedKeys | 默认选中的树节点 | String[] | [] |
|
||||
|selectedKeys | (受控)设置选中的树节点 | String[] | - |
|
||||
|multiple | 支持点选多个节点(节点本身) | boolean | false |
|
||||
|checkable | 节点前添加 Checkbox 复选框 | boolean | false |
|
||||
|defaultExpandAll | 默认展开所有树节点 | boolean | false |
|
||||
|defaultExpandedKeys | 默认展开指定的树节点 | string[] | [] |
|
||||
|expandedKeys | (受控)展开指定的树节点 | string[] | [] |
|
||||
|autoExpandParent | 是否自动展开父节点 | boolean | true |
|
||||
|defaultCheckedKeys | 默认选中复选框的树节点 | string[] | [] |
|
||||
|checkedKeys | (受控)选中复选框的树节点(注意:父子节点有关联,如果传入父节点key,则子节点自动选中;相应当子节点key都传入,父节点也自动选中。当设置`checkable`和`checkStrictly`,它是一个有`checked`和`halfChecked`属性的对象,并且父子节点的选中与否不再关联 | string[]\|{checked:string[],halfChecked:string[]} | [] |
|
||||
|checkStrictly| checkable状态下节点选择完全受控(父子节点选中状态不再关联)| boolean | false |
|
||||
|defaultSelectedKeys | 默认选中的树节点 | string[] | [] |
|
||||
|selectedKeys | (受控)设置选中的树节点 | string[] | - |
|
||||
|onExpand | 展开/收起节点时触发 | function(expandedKeys, {expanded: bool, node}) | - |
|
||||
|onCheck | 点击复选框触发 | function(checkedKeys, e:{checked: bool, checkedNodes, node, event}) | - |
|
||||
|onSelect | 点击树节点触发 | function(selectedKeys, e:{selected: bool, selectedNodes, node, event}) | - |
|
||||
|filterTreeNode | 按需筛选树节点(高亮),返回true | function(node) | - |
|
||||
|loadData | 异步加载数据 | function(node)| - |
|
||||
|onRightClick | 响应右键点击 | function({event,node}) | - |
|
||||
|draggable | 设置节点可拖拽(IE>8) | bool | false |
|
||||
|draggable | 设置节点可拖拽(IE>8) | boolean | false |
|
||||
|onDragStart | 开始拖拽时调用 | function({event,node}) | - |
|
||||
|onDragEnter | dragenter 触发时调用 | function({event,node,expandedKeys}) | - |
|
||||
|onDragOver | dragover 触发时调用 | function({event,node}) | - |
|
||||
@ -44,11 +44,11 @@ subtitle: 树形控件
|
||||
|
||||
| 参数 | 说明 | 类型 | 默认值 |
|
||||
|-----------|------------------------------------------|------------|--------|
|
||||
|disabled | 禁掉响应 | bool | false |
|
||||
|disableCheckbox | 禁掉 checkbox | bool | false |
|
||||
|title | 标题 | String/element | '---' |
|
||||
|key | 被树的 (default)ExpandedKeys / (default)CheckedKeys / (default)SelectedKeys 属性所用。注意:整个树范围内的所有节点的 key 值不能重复! | String | 内部计算出的节点位置 |
|
||||
|isLeaf | 设置为叶子节点 | bool | false |
|
||||
|disabled | 禁掉响应 | boolean | false |
|
||||
|disableCheckbox | 禁掉 checkbox | boolean | false |
|
||||
|title | 标题 | string\|ReactNode | '---' |
|
||||
|key | 被树的 (default)ExpandedKeys / (default)CheckedKeys / (default)SelectedKeys 属性所用。注意:整个树范围内的所有节点的 key 值不能重复! | string | 内部计算出的节点位置 |
|
||||
|isLeaf | 设置为叶子节点 | boolean | false |
|
||||
|
||||
## 注意
|
||||
|
||||
|
@ -20,24 +20,24 @@ Uploading is the process of publishing information (web pages, text, pictures, v
|
||||
|
||||
| Property | Description | Type | Default|
|
||||
|------------|----------------------------------------------------| ----------- |--------|
|
||||
| name | The name of uploading file | String | 'file' |
|
||||
| defaultFileList | Default list of files that have been uploaded. | Array[Object] | - |
|
||||
| fileList | List of files that have been uploaded (controlled). Here is a common issue [#2423](https://github.com/ant-design/ant-design/issues/2423) when using it | Array[Object] | - |
|
||||
| action | Required. Uploading URL | String | - |
|
||||
| data | Uploading params or function which can return uploading params. | Object or function(file) | - |
|
||||
| headers | Set request headers, valid above IE10. | Object | - |
|
||||
| showUploadList | Whether to show uploadList. | Boolean | true |
|
||||
| multiple | Whether to support selected multiple file. `IE10+` supported. You can select multiple files with CTRL holding down while multiple is set to be true | Boolean | false |
|
||||
| accept | File types that can be accepted. See [input accept Attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-accept) | String | - |
|
||||
| name | The name of uploading file | string | 'file' |
|
||||
| defaultFileList | Default list of files that have been uploaded. | object[] | - |
|
||||
| fileList | List of files that have been uploaded (controlled). Here is a common issue [#2423](https://github.com/ant-design/ant-design/issues/2423) when using it | object[] | - |
|
||||
| action | Required. Uploading URL | string | - |
|
||||
| data | Uploading params or function which can return uploading params. | object\|function(file) | - |
|
||||
| headers | Set request headers, valid above IE10. | object | - |
|
||||
| showUploadList | Whether to show uploadList. | boolean | true |
|
||||
| multiple | Whether to support selected multiple file. `IE10+` supported. You can select multiple files with CTRL holding down while multiple is set to be true | boolean | false |
|
||||
| accept | File types that can be accepted. See [input accept Attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-accept) | string | - |
|
||||
| beforeUpload | Hook function which will be executed before uploading. Uploading will be stopped with `false` or a rejected Promise returned. **Warning:this function is not supported by old IE**。 | (file, fileList) => `boolean | Promise` | - |
|
||||
| customRequest | override for the default xhr behavior allowing for additional customization and ability to implement your own XMLHttpRequest | Function | - |
|
||||
| onChange | A callback function, can be executed when uploading state is changing. See [onChange](#onChange) | Function | - |
|
||||
| listType | Built-in stylesheets, support for two types: `text` or `picture` | String | 'text'|
|
||||
| listType | Built-in stylesheets, support for two types: `text` or `picture` | string | 'text'|
|
||||
| onPreview | A callback function, will be executed when file link is clicked. | Function(file) | - |
|
||||
| onRemove | A callback function, will be executed when removing file button is clicked | Function(file) | - |
|
||||
| supportServerRender | Need to be turned on while the server side is rendering.| Boolean | false |
|
||||
| disabled | disable upload button | Boolean | false |
|
||||
| withCredentials | ajax upload with cookie sent | Boolean | false |
|
||||
| supportServerRender | Need to be turned on while the server side is rendering.| boolean | false |
|
||||
| disabled | disable upload button | boolean | false |
|
||||
| withCredentials | ajax upload with cookie sent | boolean | false |
|
||||
|
||||
### onChange
|
||||
|
||||
|
@ -21,24 +21,24 @@ title: Upload
|
||||
|
||||
| 参数 | 说明 | 类型 | 默认值|
|
||||
|------------|--------------------------------------------------------------| ----------- |-------|
|
||||
| name | 发到后台的文件参数名 | String | 'file' |
|
||||
| defaultFileList | 默认已经上传的文件列表 | Array[Object] | 无 |
|
||||
| fileList | 已经上传的文件列表(受控),使用此参数时,如果遇到 `onChange` 只调用一次的问题,请参考 [#2423](https://github.com/ant-design/ant-design/issues/2423) | Array[Object] | 无 |
|
||||
| action | 必选参数, 上传的地址 | String | 无 |
|
||||
| data | 上传所需参数或返回上传参数的方法 | Object or function(file) | 无 |
|
||||
| headers | 设置上传的请求头部,IE10 以上有效 | Object | 无 |
|
||||
| showUploadList | 是否展示 uploadList, 默认开启 | Boolean | true |
|
||||
| multiple | 是否支持多选文件,`ie10+` 支持。开启后按住 ctrl 可选择多个文件。 | Boolean | false |
|
||||
| accept | 接受上传的文件类型, 详见 [input accept Attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-accept) | String | 无 |
|
||||
| name | 发到后台的文件参数名 | string | 'file' |
|
||||
| defaultFileList | 默认已经上传的文件列表 | object[] | 无 |
|
||||
| fileList | 已经上传的文件列表(受控),使用此参数时,如果遇到 `onChange` 只调用一次的问题,请参考 [#2423](https://github.com/ant-design/ant-design/issues/2423) | object[] | 无 |
|
||||
| action | 必选参数, 上传的地址 | string | 无 |
|
||||
| data | 上传所需参数或返回上传参数的方法 | object\|function(file) | 无 |
|
||||
| headers | 设置上传的请求头部,IE10 以上有效 | object | 无 |
|
||||
| showUploadList | 是否展示 uploadList, 默认开启 | boolean | true |
|
||||
| multiple | 是否支持多选文件,`ie10+` 支持。开启后按住 ctrl 可选择多个文件。 | boolean | false |
|
||||
| accept | 接受上传的文件类型, 详见 [input accept Attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-accept) | string | 无 |
|
||||
| beforeUpload | 上传文件之前的钩子,参数为上传的文件,若返回 `false` 或者 Promise 则停止上传。**注意:该方法不支持老 IE**。 | (file, fileList) => `boolean | Promise` | 无 |
|
||||
| customRequest | 通过覆盖默认的上传行为,可以自定义自己的上传实现 | Function | 无 |
|
||||
| onChange | 上传文件改变时的状态,详见 onChange | Function | 无 |
|
||||
| listType | 上传列表的内建样式,支持两种基本样式 `text` or `picture` | String | 'text'|
|
||||
| listType | 上传列表的内建样式,支持两种基本样式 `text` or `picture` | string | 'text'|
|
||||
| onPreview | 点击文件链接时的回调 | Function(file) | 无 |
|
||||
| onRemove | 点击移除文件时的回调 | Function(file) | 无 |
|
||||
| supportServerRender | 服务端渲染时需要打开这个 | Boolean | false |
|
||||
| disabled | 是否禁用 | Boolean | false |
|
||||
| withCredentials | 上传请求时是否携带 cookie | Boolean | false |
|
||||
| supportServerRender | 服务端渲染时需要打开这个 | boolean | false |
|
||||
| disabled | 是否禁用 | boolean | false |
|
||||
| withCredentials | 上传请求时是否携带 cookie | boolean | false |
|
||||
|
||||
### onChange
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user