ant-design/components/auto-complete/demo/non-case-sensitive.md

38 lines
647 B
Markdown
Raw Normal View History

---
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
import { AutoComplete } from 'antd';
const options = [
{ value: 'Burns Bay Road' },
{ value: 'Downing Street' },
{ value: 'Wall Street' },
];
const Complete: React.FC = () => (
<AutoComplete
style={{ width: 200 }}
options={options}
placeholder="try to type `b`"
filterOption={(inputValue, option) =>
option!.value.toUpperCase().indexOf(inputValue.toUpperCase()) !== -1
}
/>
);
export default () => <Complete />;
2019-05-07 14:57:32 +08:00
```