– 方法
// 关联子公司的时候模糊查询
filterOption=(inputValue,option)=>{
if(option.key.indexOf(inputValue)!=-1){//模糊匹配
return true;
}else{
return false;
}
}
– 调方法
<Select filterOption={this.filterOption} {...getFieldProps(`orgIds`, {initialValue: this.state.children})} multiple placeholder="请选择关联的公司">
{this.state.orgList.map((org) => {
return (
<Option key={org.name} value={org.id}>{org.name}</Option>
)
})}
</Select>
showSearch:可搜索
multiple:多选