index.wxml 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <wux-cell-group
  2. id="wux-cell-group"
  3. wux-class="{{ prefixCls }}"
  4. prefixCls="{{ cellGroupPrefixCls }}"
  5. title="{{ title }}"
  6. label="{{ label }}"
  7. mode="{{ mode }}"
  8. bodyStyle="{{ bodyStyle }}"
  9. hasLine="{{ !hasFieldDecorator ? hasLine : false }}"
  10. wx:if="{{ withListComponent }}"
  11. >
  12. <block wx:for="{{ common.getOptions(options, fieldNames) }}" wx:for-item="option" wx:key="__comp_unique_key" wx:if="{{ options.length > 0 }}">
  13. <wux-radio
  14. class="{{ prefixCls + '__radio' }}"
  15. prefixCls="{{ option.prefixCls || 'wux-radio' }}"
  16. cellPrefixCls="{{ option.cellPrefixCls || 'wux-cell' }}"
  17. selectablePrefixCls="{{ option.selectablePrefixCls || 'wux-selectable' }}"
  18. thumb="{{ option.thumb || '' }}"
  19. title="{{ option.title || '' }}"
  20. label="{{ option.label || '' }}"
  21. value="{{ option.value }}"
  22. checked="{{ inputValue === option.value }}"
  23. disabled="{{ option.disabled || disabled }}"
  24. readOnly="{{ option.readOnly || readOnly }}"
  25. color="{{ option.color || 'balanced' }}"
  26. data-index="{{ index }}"
  27. bind:change="onRadioChange"
  28. />
  29. </block>
  30. <block wx:if="{{ options.length === 0 }}">
  31. <slot></slot>
  32. </block>
  33. </wux-cell-group>
  34. <block wx:else>
  35. <block wx:for="{{ common.getOptions(options, fieldNames) }}" wx:for-item="option" wx:key="__comp_unique_key" wx:if="{{ options.length > 0 }}">
  36. <wux-radio
  37. class="{{ prefixCls + '__radio' }}"
  38. prefixCls="{{ option.prefixCls || 'wux-radio' }}"
  39. cellPrefixCls="{{ option.cellPrefixCls || 'wux-cell' }}"
  40. selectablePrefixCls="{{ option.selectablePrefixCls || 'wux-selectable' }}"
  41. thumb="{{ option.thumb || '' }}"
  42. title="{{ option.title || '' }}"
  43. label="{{ option.label || '' }}"
  44. value="{{ option.value }}"
  45. checked="{{ inputValue === option.value }}"
  46. disabled="{{ option.disabled || disabled }}"
  47. readOnly="{{ option.readOnly || readOnly }}"
  48. color="{{ option.color || 'balanced' }}"
  49. data-index="{{ index }}"
  50. bind:change="onRadioChange"
  51. />
  52. </block>
  53. <block wx:if="{{ options.length === 0 }}">
  54. <slot></slot>
  55. </block>
  56. </block>
  57. <wxs src="../helpers/wxs/common.wxs" module="common" />