index.js 564 B

123456789101112131415161718192021222324252627282930
  1. import React from 'react';
  2. import { Select } from 'antd';
  3. const { Option } = Select;
  4. function DDMultiSelectField(props) {
  5. const { options, disabled, onChange } = props;
  6. return (
  7. <Select
  8. mode="multiple"
  9. allowClear
  10. style={{ width: '100%' }}
  11. disabled={disabled}
  12. onChange={value => {
  13. onChange(value);
  14. }}
  15. >
  16. {options?.map(cur => {
  17. return (
  18. <Option key={cur} value={cur}>
  19. {cur}
  20. </Option>
  21. );
  22. })}
  23. </Select>
  24. );
  25. }
  26. export default DDMultiSelectField;