ant-design/components/select/demo/optgroup.tsx
2022-11-30 22:50:57 +08:00

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;