mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-16 01:29:11 +08:00
749 B
749 B
order | title | ||||
---|---|---|---|---|---|
6 |
|
zh-CN
用 OptGroup
进行选项分组。
en-US
Using OptGroup
to group the options.
import { Select } from 'antd';
import React from 'react';
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;