docs: clean up TreeSelect deprecated usage (#21243)

pull/21268/head
偏右 5 years ago committed by GitHub
parent bebc662940
commit 369b284d8d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -40,13 +40,13 @@ class Demo extends React.Component {
treeDefaultExpandAll
onChange={this.onChange}
>
<TreeNode value="parent 1" title="parent 1" key="0-1">
<TreeNode value="parent 1-0" title="parent 1-0" key="0-1-1">
<TreeNode value="leaf1" title="my leaf" key="random" />
<TreeNode value="leaf2" title="your leaf" key="random1" />
<TreeNode value="parent 1" title="parent 1">
<TreeNode value="parent 1-0" title="parent 1-0">
<TreeNode value="leaf1" title="my leaf" />
<TreeNode value="leaf2" title="your leaf" />
</TreeNode>
<TreeNode value="parent 1-1" title="parent 1-1" key="random2">
<TreeNode value="sss" title={<b style={{ color: '#08c' }}>sss</b>} key="random3" />
<TreeNode value="parent 1-1" title="parent 1-1">
<TreeNode value="sss" title={<b style={{ color: '#08c' }}>sss</b>} />
</TreeNode>
</TreeNode>
</TreeSelect>

@ -72,7 +72,7 @@ class Demo extends React.Component {
onChange: this.onChange,
treeCheckable: true,
showCheckedStrategy: SHOW_PARENT,
searchPlaceholder: 'Please select',
placeholder: 'Please select',
style: {
width: '100%',
},

@ -41,13 +41,13 @@ class Demo extends React.Component {
treeDefaultExpandAll
onChange={this.onChange}
>
<TreeNode value="parent 1" title="parent 1" key="0-1">
<TreeNode value="parent 1-0" title="parent 1-0" key="0-1-1">
<TreeNode value="leaf1" title="my leaf" key="random" />
<TreeNode value="leaf2" title="your leaf" key="random1" />
<TreeNode value="parent 1" title="parent 1">
<TreeNode value="parent 1-0" title="parent 1-0">
<TreeNode value="leaf1" title="my leaf" />
<TreeNode value="leaf2" title="your leaf" />
</TreeNode>
<TreeNode value="parent 1-1" title="parent 1-1" key="random2">
<TreeNode value="sss" title={<b style={{ color: '#08c' }}>sss</b>} key="random3" />
<TreeNode value="parent 1-1" title="parent 1-1">
<TreeNode value="sss" title={<b style={{ color: '#08c' }}>sss</b>} />
</TreeNode>
</TreeNode>
</TreeSelect>

@ -44,13 +44,13 @@ class Demo extends React.Component {
treeDefaultExpandAll
onChange={this.onChange}
>
<TreeNode value="parent 1" title="parent 1" key="0-1">
<TreeNode value="parent 1-0" title="parent 1-0" key="0-1-1">
<TreeNode value="leaf1" title="my leaf" key="random" />
<TreeNode value="leaf2" title="your leaf" key="random1" />
<TreeNode value="parent 1" title="parent 1">
<TreeNode value="parent 1-0" title="parent 1-0">
<TreeNode value="leaf1" title="my leaf" />
<TreeNode value="leaf2" title="your leaf" />
</TreeNode>
<TreeNode value="parent 1-1" title="parent 1-1" key="random2">
<TreeNode value="sss" title={<b style={{ color: '#08c' }}>sss</b>} key="random3" />
<TreeNode value="parent 1-1" title="parent 1-1">
<TreeNode value="sss" title={<b style={{ color: '#08c' }}>sss</b>} />
</TreeNode>
</TreeNode>
</TreeSelect>

@ -20,24 +20,20 @@ const treeData = [
{
title: 'Node1',
value: '0-0',
key: '0-0',
children: [
{
title: 'Child Node1',
value: '0-0-1',
key: '0-0-1',
},
{
title: 'Child Node2',
value: '0-0-2',
key: '0-0-2',
},
],
},
{
title: 'Node2',
value: '0-1',
key: '0-1',
},
];

@ -31,7 +31,6 @@ Tree selection control.
| maxTagPlaceholder | Placeholder for not showing tags | ReactNode/function(omittedValues) | - | |
| multiple | Support multiple or not, will be `true` when enable `treeCheckable`. | boolean | false | |
| placeholder | Placeholder of the select input | string | - | |
| searchPlaceholder | Placeholder of the search input | string | - | |
| searchValue | work with `onSearch` to make search value controlled. | string | - | |
| treeIcon | Shows the icon before a TreeNode's title. There is no default style; you must set a custom style for it if set to `true` | boolean | false | |
| showCheckedStrategy | The way show selected item in box. **Default:** just show child nodes. **`TreeSelect.SHOW_ALL`:** show all checked treeNodes (include parent treeNode). **`TreeSelect.SHOW_PARENT`:** show checked treeNodes (just show parent treeNode). | enum { TreeSelect.SHOW_ALL, TreeSelect.SHOW_PARENT, TreeSelect.SHOW_CHILD } | TreeSelect.SHOW_CHILD | |

@ -32,7 +32,6 @@ title: TreeSelect
| maxTagPlaceholder | 隐藏 tag 时显示的内容 | ReactNode/function(omittedValues) | - | |
| multiple | 支持多选(当设置 treeCheckable 时自动变为 true | boolean | false | |
| placeholder | 选择框默认文字 | string | - | |
| searchPlaceholder | 搜索框默认文字 | string | - | |
| searchValue | 搜索框的值,可以通过 `onSearch` 获取用户输入 | string | - | |
| treeIcon | 是否展示 TreeNode title 前的图标,没有默认样式,如设置为 true需要自行定义图标相关样式 | boolean | false | |
| showCheckedStrategy | 定义选中项回填的方式。`TreeSelect.SHOW_ALL`: 显示所有选中节点(包括父节点). `TreeSelect.SHOW_PARENT`: 只显示父节点(当父节点下所有子节点都选中时). 默认只显示子节点. | enum{TreeSelect.SHOW_ALL, TreeSelect.SHOW_PARENT, TreeSelect.SHOW_CHILD } | TreeSelect.SHOW_CHILD | |

Loading…
Cancel
Save