---
title: 分组选择 组件
sidemenu: true
---

## 分组选择

这个组件可以用来选择分组，比如：产品线、业务线、部门等。添加了全选逻辑
```tsx
/**
 * background: '#f0f2f5'
 */

import React from 'react';
import GroupSelect from '@/components/GroupSelect';
export default () => {
  const options = [
    {
      label: '产品线',
      options: [
        {
          label: '产品A',
          value: 'productA'
        },
        {
          label: '产品B',
          value: 'productB'
        }
      ]
    },
    {
      label: '业务线',
      options: [
        {
          label: '业务A',
          value: 'businessA'
        },
        {
          label: '业务B',
          value: 'businessB'
        }
      ]
    }
  ];
  return (
    <>
      <GroupSelect style={{ width: 300 }} options={options}/>
    </>
  );
};
```

<API src="./index.tsx"></API>
