样式:
关键代码:
<Select
options={contractOption}
allowClear
showSearch
optionFilterProp="children"
//关键代码
filterOption={(input, option: any) =>
option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0
}
dropdownStyle={{ maxHeight: 400, overflow: 'auto' }} //控制下拉框下拉弹窗的样式
onChange={(value, option: any) => {
searchForm.setFieldsValue({
'contractName': option?.label
})
console.log(value, option);
}}
>
</Select>
样式:
关键代码:
<TreeSelect
treeDataSimpleMode
placeholder="请选择"
treeNodeFilterProp='title' //关键代码
value={valueId}
allowClear
style={{ width: '500px', marginLeft: '30px' }}
labelInValue
onChange={onChangeId}
treeData={treeSelData}
showSearch/>