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

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