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
|
|
|
|
|
2020-01-21 16:21:37 +08:00
|
|
|
```tsx
|
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
|
|
|
|
2020-05-09 19:32:02 +08:00
|
|
|
const Complete: React.FC = () => (
|
|
|
|
<AutoComplete
|
|
|
|
style={{ width: 200 }}
|
|
|
|
options={options}
|
|
|
|
placeholder="try to type `b`"
|
|
|
|
filterOption={(inputValue, option) =>
|
2020-12-17 15:09:18 +08:00
|
|
|
option!.value.toUpperCase().indexOf(inputValue.toUpperCase()) !== -1
|
2020-05-09 19:32:02 +08:00
|
|
|
}
|
|
|
|
/>
|
|
|
|
);
|
2017-02-13 15:45:49 +08:00
|
|
|
|
2022-04-03 23:27:45 +08:00
|
|
|
export default () => <Complete />;
|
2019-05-07 14:57:32 +08:00
|
|
|
```
|