index.wxml 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <wxs
  2. src="../index.wxs"
  3. module="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 wx:if="{{ position === 'vertical' }}">
  12. <block
  13. wx:for="{{ options }}"
  14. wx:for-index="index"
  15. wx: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. bind:change="onChange">
  24. <view class="ant-checkbox-group-item-label-default">
  25. {{ item.label }}
  26. </view>
  27. </ant-checkbox>
  28. </list-item>
  29. </block>
  30. </block>
  31. <block wx:else>
  32. <block
  33. wx:for="{{ options }}"
  34. wx:for-index="index"
  35. wx:for-item="item">
  36. <ant-checkbox
  37. color="{{ color }}"
  38. checked="{{ componentUtils.getCheckboxChecked(item, mixin.value) }}"
  39. data-index="{{ index }}"
  40. value="{{ item.value }}"
  41. disabled="{{ disabled || item.disabled }}"
  42. bind:change="onChange">
  43. <view class="ant-checkbox-group-item-label-default">
  44. {{ item.label }}
  45. </view>
  46. </ant-checkbox>
  47. </block>
  48. </block>
  49. </view>
  50. </checkbox-group>
  51. </list>