mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-30 20:38:45 +08:00
22 lines
458 B
TypeScript
22 lines
458 B
TypeScript
|
import React from 'react';
|
||
|
import { AutoComplete } from 'antd';
|
||
|
|
||
|
const options = [
|
||
|
{ value: 'Burns Bay Road' },
|
||
|
{ value: 'Downing Street' },
|
||
|
{ value: 'Wall Street' },
|
||
|
];
|
||
|
|
||
|
const App: 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 App;
|