2017-02-13 15:45:49 +08:00
|
|
|
---
|
|
|
|
order: 3
|
|
|
|
title:
|
|
|
|
zh-CN: 不区分大小写
|
|
|
|
en-US: Non-case-sensitive AutoComplete
|
|
|
|
---
|
|
|
|
|
|
|
|
## zh-CN
|
|
|
|
|
|
|
|
不区分大小写的 AutoComplete
|
|
|
|
|
|
|
|
## en-US
|
|
|
|
|
|
|
|
A non-case-sensitive AutoComplete
|
|
|
|
|
|
|
|
````jsx
|
|
|
|
import { AutoComplete } from 'antd';
|
|
|
|
|
|
|
|
const dataSource = ['Burns Bay Road', 'Downing Street', 'Wall Street'];
|
|
|
|
|
|
|
|
function Complete() {
|
2017-02-19 20:12:41 +08:00
|
|
|
return (
|
|
|
|
<AutoComplete
|
|
|
|
style={{ width: 200 }}
|
|
|
|
dataSource={dataSource}
|
|
|
|
placeholder="try to type `b`"
|
|
|
|
filterOption={(inputValue, option) => option.props.children.toUpperCase().indexOf(inputValue.toUpperCase()) !== -1}
|
|
|
|
/>
|
|
|
|
);
|
2017-02-13 15:45:49 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
ReactDOM.render(<Complete />, mountNode);
|
|
|
|
````
|