Browse Source

Merge pull request #16369 from ant-design/treenode-checkable

feat: TreeNode support checkable
pull/16402/head
陈帅 6 years ago
committed by GitHub
parent
commit
6e6e1ecadc
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      components/tree/Tree.tsx
  2. 19
      components/tree/index.en-US.md
  3. 19
      components/tree/index.zh-CN.md
  4. 2
      package.json

1
components/tree/Tree.tsx

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

19
components/tree/index.en-US.md

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

19
components/tree/index.zh-CN.md

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

2
package.json

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

Loading…
Cancel
Save