en-US
Group options.
zh-CN
对选项进行分组。
import { DSelect } from '@react-devui/ui';
const list = [
{
label: 'Group 1',
value: 'Group1',
children: Array.from({ length: 3 }).map((_, index) => ({
label: `Item ${index}`,
value: 'Group1-' + index,
})),
},
{
label: 'Group 2',
value: 'Group2',
children: [],
},
{
label: 'Group 3',
value: 'Group3',
children: Array.from({ length: 100 }).map((_, index) => ({
label: `Item 3${index}`,
value: 'Group3-' + index,
disabled: index === 3,
})),
},
];
export default function Demo() {
return <DSelect style={{ width: 200 }} dList={list} dPlaceholder="Group" dSearchable dClearable />;
}