mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-11-30 11:08:45 +08:00
35 lines
757 B
TypeScript
35 lines
757 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: <span>manager</span>,
|
|
title: 'manager',
|
|
options: [
|
|
{ label: <span>Jack</span>, value: 'Jack' },
|
|
{ label: <span>Lucy</span>, value: 'Lucy' },
|
|
],
|
|
},
|
|
{
|
|
label: <span>engineer</span>,
|
|
title: 'engineer',
|
|
options: [
|
|
{ label: <span>Chloe</span>, value: 'Chloe' },
|
|
{ label: <span>Lucas</span>, value: 'Lucas' },
|
|
],
|
|
},
|
|
]}
|
|
/>
|
|
);
|
|
|
|
export default App;
|