mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-15 00:29:12 +08:00
37 lines
616 B
TypeScript
37 lines
616 B
TypeScript
import React from 'react';
|
|
import { Select } from 'antd';
|
|
|
|
const onChange = (value: string) => {
|
|
console.log(`selected ${value}`);
|
|
};
|
|
|
|
const onSearch = (value: string) => {
|
|
console.log('search:', value);
|
|
};
|
|
|
|
const App: React.FC = () => (
|
|
<Select
|
|
showSearch
|
|
placeholder="Select a person"
|
|
optionFilterProp="label"
|
|
onChange={onChange}
|
|
onSearch={onSearch}
|
|
options={[
|
|
{
|
|
value: 'jack',
|
|
label: 'Jack',
|
|
},
|
|
{
|
|
value: 'lucy',
|
|
label: 'Lucy',
|
|
},
|
|
{
|
|
value: 'tom',
|
|
label: 'Tom',
|
|
},
|
|
]}
|
|
/>
|
|
);
|
|
|
|
export default App;
|