You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
577 B
29 lines
577 B
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;
|
|
|