index.axml 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <import-sjs
  2. from="../index.sjs"
  3. name="componentUtils" />
  4. <list
  5. className="ant-checkbox-group {{ className ? className : '' }} ant-checkbox-group-{{ position }}"
  6. style="{{ style }}">
  7. <checkbox-group
  8. name="{{ name }}"
  9. value="{{ mixin.value }}">
  10. <view class="ant-checkbox-group-body">
  11. <block a:if="{{ position === 'vertical' }}">
  12. <block
  13. a:for="{{ options }}"
  14. a:for-index="index"
  15. a:for-item="item">
  16. <list-item>
  17. <ant-checkbox
  18. color="{{ color }}"
  19. checked="{{ componentUtils.getCheckboxChecked(item, mixin.value) }}"
  20. data-index="{{ index }}"
  21. value="{{ item.value }}"
  22. disabled="{{ disabled || item.disabled }}"
  23. onChange="onChange">
  24. <slot
  25. name="label"
  26. value="{{ item }}"
  27. index="{{ index }}">
  28. <view class="ant-checkbox-group-item-label-default">
  29. {{ item.label }}
  30. </view>
  31. </slot>
  32. </ant-checkbox>
  33. </list-item>
  34. </block>
  35. </block>
  36. <block a:else>
  37. <block
  38. a:for="{{ options }}"
  39. a:for-index="index"
  40. a:for-item="item">
  41. <ant-checkbox
  42. color="{{ color }}"
  43. checked="{{ componentUtils.getCheckboxChecked(item, mixin.value) }}"
  44. data-index="{{ index }}"
  45. value="{{ item.value }}"
  46. disabled="{{ disabled || item.disabled }}"
  47. onChange="onChange">
  48. <slot
  49. name="label"
  50. value="{{ item }}"
  51. index="{{ index }}">
  52. <view class="ant-checkbox-group-item-label-default">
  53. {{ item.label }}
  54. </view>
  55. </slot>
  56. </ant-checkbox>
  57. </block>
  58. </block>
  59. </view>
  60. </checkbox-group>
  61. </list>