From df3617ddede397950ca77b874bbd81e2e62c5840 Mon Sep 17 00:00:00 2001 From: afc163 Date: Fri, 17 Feb 2017 00:59:11 +0800 Subject: [PATCH] docs: improve API table layout --- components/tree-select/index.en-US.md | 4 ++-- components/tree-select/index.zh-CN.md | 4 ++-- components/tree/index.en-US.md | 14 +++++++------- components/tree/index.zh-CN.md | 14 +++++++------- 4 files changed, 18 insertions(+), 18 deletions(-) diff --git a/components/tree-select/index.en-US.md b/components/tree-select/index.en-US.md index 75ff2c546..cba439a42 100644 --- a/components/tree-select/index.en-US.md +++ b/components/tree-select/index.en-US.md @@ -18,8 +18,8 @@ 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\|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 +value | To set the current selected treeNode(s). | string\|string[] | - +labelInValue | whether to embed label in value, turn the format of value from `string` to `{key: string, label: ReactNode, halfChecked: string[]} | 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) | - diff --git a/components/tree-select/index.zh-CN.md b/components/tree-select/index.zh-CN.md index 0a43d30ce..92a79775b 100644 --- a/components/tree-select/index.zh-CN.md +++ b/components/tree-select/index.zh-CN.md @@ -17,8 +17,8 @@ title: TreeSelect | 参数 | 说明 | 类型 | 默认值 | |-----------|------------------------------------------|------------|--------| -| 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 | +| value | 指定当前选中的条目 | string/string[] | - | +| labelInValue | 是否把每个选项的 label 包装到 value 中,会把 value 类型从 `string` 变为 `{key: string, label: ReactNode, halfChecked(treeCheckStrictly 时有效): string[] }` 的格式 | boolean | false | | defaultValue | 指定默认选中的条目 | string/string[] | - | | multiple | 支持多选(当设置 treeCheckable 时自动变为true) | boolean | false | | onSelect | 被选中时调用 | function(value, node, extra) | - | diff --git a/components/tree/index.en-US.md b/components/tree/index.en-US.md index 5061f1de6..d099c7bcb 100644 --- a/components/tree/index.en-US.md +++ b/components/tree/index.en-US.md @@ -21,7 +21,7 @@ Directory, organization, biological classification, country, and etc. Almost thi |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[]} | [] | +|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[] | - | @@ -30,13 +30,13 @@ Directory, organization, biological classification, country, and etc. Almost thi |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}) | - | +|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) | 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}) | - | -|onDragLeave | Defines a function will be called when the onDragLeave event occurs | function({event,node}) | - | -|onDragEnd | Defines a function will be called when the onDragEnd event occurs | function({event,node}) | - | +|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}) | - | +|onDragLeave | Defines a function will be called when the onDragLeave event occurs | function({event, node}) | - | +|onDragEnd | Defines a function will be called when the onDragEnd event occurs | function({event, node}) | - | |onDrop | Defines a function will be called when the onDrop event occurs | function({event, node, dragNode, dragNodesKeys}) | - | ### TreeNode props diff --git a/components/tree/index.zh-CN.md b/components/tree/index.zh-CN.md index c4a4f33fd..d4c948f51 100644 --- a/components/tree/index.zh-CN.md +++ b/components/tree/index.zh-CN.md @@ -22,7 +22,7 @@ subtitle: 树形控件 |expandedKeys | (受控)展开指定的树节点 | string[] | [] | |autoExpandParent | 是否自动展开父节点 | boolean | true | |defaultCheckedKeys | 默认选中复选框的树节点 | string[] | [] | -|checkedKeys | (受控)选中复选框的树节点(注意:父子节点有关联,如果传入父节点key,则子节点自动选中;相应当子节点key都传入,父节点也自动选中。当设置`checkable`和`checkStrictly`,它是一个有`checked`和`halfChecked`属性的对象,并且父子节点的选中与否不再关联 | string[]\|{checked:string[],halfChecked:string[]} | [] | +|checkedKeys | (受控)选中复选框的树节点(注意:父子节点有关联,如果传入父节点key,则子节点自动选中;相应当子节点key都传入,父节点也自动选中。当设置`checkable`和`checkStrictly`,它是一个有`checked`和`halfChecked`属性的对象,并且父子节点的选中与否不再关联 | string[] \| {checked: string[], halfChecked: string[]} | [] | |checkStrictly| checkable状态下节点选择完全受控(父子节点选中状态不再关联)| boolean | false | |defaultSelectedKeys | 默认选中的树节点 | string[] | [] | |selectedKeys | (受控)设置选中的树节点 | string[] | - | @@ -31,13 +31,13 @@ subtitle: 树形控件 |onSelect | 点击树节点触发 | function(selectedKeys, e:{selected: bool, selectedNodes, node, event}) | - | |filterTreeNode | 按需筛选树节点(高亮),返回true | function(node) | - | |loadData | 异步加载数据 | function(node)| - | -|onRightClick | 响应右键点击 | function({event,node}) | - | +|onRightClick | 响应右键点击 | function({event, node}) | - | |draggable | 设置节点可拖拽(IE>8) | boolean | false | -|onDragStart | 开始拖拽时调用 | function({event,node}) | - | -|onDragEnter | dragenter 触发时调用 | function({event,node,expandedKeys}) | - | -|onDragOver | dragover 触发时调用 | function({event,node}) | - | -|onDragLeave | dragleave 触发时调用 | function({event,node}) | - | -|onDragEnd | dragend 触发时调用 | function({event,node}) | - | +|onDragStart | 开始拖拽时调用 | function({event, node}) | - | +|onDragEnter | dragenter 触发时调用 | function({event, node, expandedKeys}) | - | +|onDragOver | dragover 触发时调用 | function({event, node}) | - | +|onDragLeave | dragleave 触发时调用 | function({event, node}) | - | +|onDragEnd | dragend 触发时调用 | function({event, node}) | - | |onDrop | drop 触发时调用 | function({event, node, dragNode, dragNodesKeys}) | - | ### TreeNode props