index.axml 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <import-sjs
  2. from="../index.sjs"
  3. name="componentUtils" />
  4. <list
  5. className="ant-radio-group {{ className ? className : '' }} ant-radio-group-{{ position }}"
  6. style="{{ style }}">
  7. <radio-group
  8. name="{{ name }}"
  9. value="{{ mixin.value }}">
  10. <view class="ant-radio-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. <radio
  18. checked="{{ componentUtils.getChecked(index, options, mixin.value) }}"
  19. data-index="{{ index }}"
  20. value="{{ item.value }}"
  21. disabled="{{ disabled || item.disabled }}"
  22. color="{{ item.color || color }}"
  23. onChange="onChange">
  24. <slot
  25. name="label"
  26. value="{{ item }}"
  27. index="{{ index }}">
  28. <view class="ant-radio-group-item-label-default">
  29. {{ item.label }}
  30. </view>
  31. </slot>
  32. </radio>
  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. <radio
  42. checked="{{ componentUtils.getChecked(index, options, mixin.value) }}"
  43. data-index="{{ index }}"
  44. value="{{ item.value }}"
  45. disabled="{{ disabled || item.disabled }}"
  46. color="{{ item.color || color }}"
  47. onChange="onChange">
  48. <slot
  49. name="label"
  50. value="{{ item }}"
  51. index="{{ index }}">
  52. <view class="ant-radio-group-item-label-default">
  53. {{ item.label }}
  54. </view>
  55. </slot>
  56. </radio>
  57. </block>
  58. </block>
  59. </view>
  60. </radio-group>
  61. </list>