ant-design/components/auto-complete/demo/non-case-sensitive.md
偏右 2beb28518c
test: Alert and AutoComplete test coverage (#24004)
* 🔨 refactor demo code style

* refactor alert code and fix test cov

* add test case for AutoComplete

* fix test
2020-05-09 19:32:02 +08:00

38 lines
653 B
Markdown

---
order: 3
title:
zh-CN: 不区分大小写
en-US: Non-case-sensitive AutoComplete
---
## zh-CN
不区分大小写的 AutoComplete
## en-US
A non-case-sensitive AutoComplete
```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
}
/>
);
ReactDOM.render(<Complete />, mountNode);
```