upgrade treeSelect

This commit is contained in:
然则 2016-03-14 16:18:30 +08:00
parent 5ec436d0dd
commit e1f27bbe4d
4 changed files with 8 additions and 2 deletions

View File

@ -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,

View File

@ -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;

View File

@ -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) | - |

View File

@ -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",