index.sjs 471 B

123456789101112131415161718192021
  1. function getClassName(checked, disabled) {
  2. if (!checked && !disabled) {
  3. return 'icon';
  4. }
  5. if (checked && !disabled) {
  6. return 'checkedIcon';
  7. }
  8. if (!checked && disabled) {
  9. return 'disbaledIcon';
  10. }
  11. if (checked && disabled) {
  12. return 'disabledCheckedIcon';
  13. }
  14. }
  15. function getCheckboxChecked(item, value) {
  16. return (value || []).indexOf(item.value) > -1;
  17. }
  18. export default {
  19. getClassName: getClassName,
  20. getCheckboxChecked: getCheckboxChecked
  21. };