mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-12-16 01:41:02 +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;
|