mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-05 01:19:45 +08:00
240b8044e7
* feat: upgrade rc-select version and add demo to bring in filterSort functionality * fix: lint error * fix: add filterSort support version in doc and update demo order * fix: update doc
917 B
917 B
order | title | ||||
---|---|---|---|---|---|
4 |
|
zh-CN
在搜索模式下对过滤结果项进行排序。
en-US
Search the options with sorting.
import { Select } from 'antd';
const { Option } = Select;
ReactDOM.render(
<Select
showSearch
style={{ width: 200 }}
placeholder="Search to Select"
optionFilterProp="children"
filterOption={(input, option) =>
option.children.toLowerCase().indexOf(input.toLowerCase()) >= 0
}
filterSort={(optionA, optionB) =>
optionA.children.toLowerCase().localeCompare(optionB.children.toLowerCase())
}
>
<Option value="1">Not Identified</Option>
<Option value="2">Closed</Option>
<Option value="3">Communicated</Option>
<Option value="4">Identified</Option>
<Option value="5">Resolved</Option>
<Option value="6">Cancelled</Option>
</Select>,
mountNode,
);