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
|
|
|
|
|
2019-05-07 14:57:32 +08:00
|
|
|
```jsx
|
2017-02-13 15:45:49 +08:00
|
|
|
import { AutoComplete } from 'antd';
|
|
|
|
|
2019-09-12 20:15:17 +08:00
|
|
|
const options = [
|
|
|
|
{ value: 'Burns Bay Road' },
|
|
|
|
{ value: 'Downing Street' },
|
|
|
|
{ value: 'Wall Street' },
|
|
|
|
];
|
2017-02-13 15:45:49 +08:00
|
|
|
|
|
|
|
function Complete() {
|
2017-02-19 20:12:41 +08:00
|
|
|
return (
|
|
|
|
<AutoComplete
|
|
|
|
style={{ width: 200 }}
|
2019-09-12 20:15:17 +08:00
|
|
|
options={options}
|
2017-02-19 20:12:41 +08:00
|
|
|
placeholder="try to type `b`"
|
2019-05-07 14:57:32 +08:00
|
|
|
filterOption={(inputValue, option) =>
|
2019-11-23 23:27:25 +08:00
|
|
|
option.value.toUpperCase().indexOf(inputValue.toUpperCase()) !== -1
|
2019-05-07 14:57:32 +08:00
|
|
|
}
|
2017-02-19 20:12:41 +08:00
|
|
|
/>
|
|
|
|
);
|
2017-02-13 15:45:49 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
ReactDOM.render(<Complete />, mountNode);
|
2019-05-07 14:57:32 +08:00
|
|
|
```
|