mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-05 09:49:57 +08:00
30 lines
577 B
TypeScript
30 lines
577 B
TypeScript
import React from 'react';
|
|
import { Select } from 'antd';
|
|
|
|
const handleChange = (value: string) => {
|
|
console.log(`selected ${value}`);
|
|
};
|
|
|
|
const App: React.FC = () => (
|
|
<Select
|
|
defaultValue="lucy"
|
|
style={{ width: 200 }}
|
|
onChange={handleChange}
|
|
options={[
|
|
{
|
|
label: 'Manager',
|
|
options: [
|
|
{ label: 'Jack', value: 'jack' },
|
|
{ label: 'Lucy', value: 'lucy' },
|
|
],
|
|
},
|
|
{
|
|
label: 'Engineer',
|
|
options: [{ label: 'yiminghe', value: 'Yiminghe' }],
|
|
},
|
|
]}
|
|
/>
|
|
);
|
|
|
|
export default App;
|