ant-design/components/auto-complete/demo/non-case-sensitive.md
2020-01-21 16:21:37 +08:00

713 B

order title
3
zh-CN en-US
不区分大小写 Non-case-sensitive AutoComplete

zh-CN

不区分大小写的 AutoComplete

en-US

A non-case-sensitive AutoComplete

import React, { FC } from 'react';
import { AutoComplete } from 'antd';

const options = [
  { value: 'Burns Bay Road' },
  { value: 'Downing Street' },
  { value: 'Wall Street' },
];

const Complete: FC = () => {
  return (
    <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);