diff --git a/components/tree-select/demo/checkable.md b/components/tree-select/demo/checkable.md index 154b0fb90e..12657c4d20 100644 --- a/components/tree-select/demo/checkable.md +++ b/components/tree-select/demo/checkable.md @@ -8,6 +8,7 @@ ````jsx import { TreeSelect } from 'antd'; +const SHOW_PARENT = TreeSelect.SHOW_PARENT; const treeData = [{ label: '节点一', @@ -54,6 +55,7 @@ const Demo = React.createClass({ onChange: this.onChange, multiple: true, treeCheckable: true, + showCheckedStrategy: SHOW_PARENT, searchPlaceholder: '请选择', style: { width: 300, diff --git a/components/tree-select/index.jsx b/components/tree-select/index.jsx index f261129d82..850274f496 100644 --- a/components/tree-select/index.jsx +++ b/components/tree-select/index.jsx @@ -1,5 +1,5 @@ import React from 'react'; -import TreeSelect, { TreeNode } from 'rc-tree-select'; +import TreeSelect, { TreeNode, SHOW_ALL, SHOW_PARENT, SHOW_CHILD } from 'rc-tree-select'; import classNames from 'classnames'; const AntTreeSelect = React.createClass({ @@ -42,4 +42,7 @@ const AntTreeSelect = React.createClass({ }); AntTreeSelect.TreeNode = TreeNode; +AntTreeSelect.SHOW_ALL = SHOW_ALL; +AntTreeSelect.SHOW_PARENT = SHOW_PARENT; +AntTreeSelect.SHOW_CHILD = SHOW_CHILD; export default AntTreeSelect; diff --git a/components/tree-select/index.md b/components/tree-select/index.md index c5bfe4ef0a..2ecb4cd2be 100644 --- a/components/tree-select/index.md +++ b/components/tree-select/index.md @@ -34,6 +34,7 @@ | 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 | 默认展开所有树节点 | bool | false | | treeCheckable | 显示checkbox | bool | false | | filterTreeNode | 是否根据输入项进行筛选,返回值true | function(treeNode) | - | diff --git a/package.json b/package.json index 73d5e20b74..188748d19a 100644 --- a/package.json +++ b/package.json @@ -63,7 +63,7 @@ "rc-time-picker": "~1.1.0", "rc-tooltip": "~3.3.1", "rc-tree": "~1.1.0", - "rc-tree-select": "~1.2.2", + "rc-tree-select": "~1.4.1", "rc-trigger": "~1.2.0", "rc-upload": "~1.8.0", "rc-util": "~3.1.2",