GroupNameControl.tsx 534 B

123456789101112131415161718192021
  1. import { ArrayItems } from '@formily/antd';
  2. import { Select } from 'antd';
  3. const GroupNameControl = (props: { name: string }) => {
  4. const index = ArrayItems.useIndex!();
  5. return (
  6. <>
  7. {index === 0 ? (
  8. <div style={{ textAlign: 'center', fontWeight: 600 }}>{props?.name || '第一组'}</div>
  9. ) : (
  10. <Select
  11. options={[
  12. { label: '并且', value: 'and' },
  13. { label: '或者', value: 'or' },
  14. ]}
  15. />
  16. )}
  17. </>
  18. );
  19. };
  20. export default GroupNameControl;