pro-components
pro-components copied to clipboard
🐛[BUG] ProFormTreeSelect 设置 treeNodeFilterProp='title' 无效
trafficstars
提问前先看看:
https://github.com/ryanhanwu/How-To-Ask-Questions-The-Smart-Way/blob/main/README-zh_CN.md
🐛 bug 描述
ProFormTreeSelect存在一种bug,当fieldProps中的treeData存在时,无论怎么设置treeNodeFilterProp,都会以value
作为搜索属性,这里是我是想把treeNodeFilterProp设置为title,但是并没有成功
📷 复现步骤
<ProFormTreeSelect
name="name"
placeholder="Please select"
allowClear
width={330}
secondary
// tree-select args
fieldProps={{
showArrow: false,
filterTreeNode: true,
showSearch: true,
dropdownMatchSelectWidth: false,
autoClearSearchValue: true,
multiple: true,
treeNodeFilterProp: 'title',
fieldNames: {
label: 'title',
},
treeData: [
{
title: 'Node1',
value: '0-0',
children: [
{
title: 'Child Node1',
value: '0-0-0',
},
],
},
{
title: 'Node2',
value: '0-1',
children: [
{
title: 'Child Node3',
value: '0-1-0',
},
{
title: 'Child Node4',
value: '0-1-1',
},
{
title: 'Child Node5',
value: '0-1-2',
},
],
},
]
}}
/>