feat: TreeNode support checkable

This commit is contained in:
zombiej 2019-04-28 20:23:15 +08:00
parent 34f24a88a9
commit f21b30dcb0
4 changed files with 22 additions and 19 deletions

View File

@ -27,6 +27,7 @@ export interface AntdTreeNodeAttribute {
}
export interface AntTreeNodeProps {
className?: string;
checkable?: boolean;
disabled?: boolean;
disableCheckbox?: boolean;
title?: string | React.ReactNode;

View File

@ -49,15 +49,16 @@ Almost anything can be represented in a tree structure. Examples include directo
### TreeNode props
| Property | Description | Type | Default |
| -------- | ----------- | ---- | ------- |
| disableCheckbox | Disables the checkbox of the treeNode | boolean | false |
| disabled | Disables the treeNode | boolean | false |
| icon | customize icon. When you pass component, whose render will receive full TreeNode props as component props | ReactNode/Function(props):ReactNode | - |
| isLeaf | Determines if this is a leaf node(effective when `loadData` is specified) | boolean | false |
| key | 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 |
| selectable | Set whether the treeNode can be selected | boolean | true |
| title | Title | string\|ReactNode | '---' |
| Property | Description | Type | Default | Version |
| -------- | ----------- | ---- | ------- | ------- |
| checkable | When Tree is checkable, set TreeNode display Checkbox or not | boolean | - | 3.17.0 |
| disableCheckbox | Disables the checkbox of the treeNode | boolean | false | |
| disabled | Disables the treeNode | boolean | false | |
| icon | customize icon. When you pass component, whose render will receive full TreeNode props as component props | ReactNode/Function(props):ReactNode | - | |
| isLeaf | Determines if this is a leaf node(effective when `loadData` is specified) | boolean | false | |
| key | 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 | |
| selectable | Set whether the treeNode can be selected | boolean | true | |
| title | Title | string\|ReactNode | '---' | |
### DirectoryTree props

View File

@ -50,15 +50,16 @@ subtitle: 树形控件
### TreeNode props
| 参数 | 说明 | 类型 | 默认值 |
| --- | --- | --- | --- |
| disableCheckbox | 禁掉 checkbox | boolean | false |
| disabled | 禁掉响应 | boolean | false |
| icon | 自定义图标。可接收组件props 为当前节点 props | ReactNode/Function(props):ReactNode | - |
| isLeaf | 设置为叶子节点(设置了`loadData`时有效) | boolean | false |
| key | 被树的 (default)ExpandedKeys / (default)CheckedKeys / (default)SelectedKeys 属性所用。注意:整个树范围内的所有节点的 key 值不能重复! | string | 内部计算出的节点位置 |
| selectable | 设置节点是否可被选中 | boolean | true |
| title | 标题 | string\|ReactNode | '---' |
| 参数 | 说明 | 类型 | 默认值 | 版本 |
| --- | --- | --- | --- | --- |
| checkable | 当树为 checkable 时,设置独立节点是否展示 Checkbox | boolean | - | 3.17.0 |
| disableCheckbox | 禁掉 checkbox | boolean | false | |
| disabled | 禁掉响应 | boolean | false | |
| icon | 自定义图标。可接收组件props 为当前节点 props | ReactNode/Function(props):ReactNode | - | |
| isLeaf | 设置为叶子节点(设置了`loadData`时有效) | boolean | false | |
| key | 被树的 (default)ExpandedKeys / (default)CheckedKeys / (default)SelectedKeys 属性所用。注意:整个树范围内的所有节点的 key 值不能重复! | string | 内部计算出的节点位置 | |
| selectable | 设置节点是否可被选中 | boolean | true | |
| title | 标题 | string\|ReactNode | '---' | |
### DirectoryTree props

View File

@ -83,7 +83,7 @@
"rc-tabs": "~9.6.0",
"rc-time-picker": "~3.6.1",
"rc-tooltip": "~3.7.3",
"rc-tree": "~2.0.0",
"rc-tree": "~2.1.0",
"rc-tree-select": "~2.8.0",
"rc-trigger": "^2.6.2",
"rc-upload": "~2.6.0",