select-menu.wxml 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. <scroll-view scroll-y scroll-top="{{ scrollTop }}" style="max-height: {{ height + 'px' }};" wx:if="{{ options.length > 0 }}">
  2. <wux-radio-group
  3. id="wux-select"
  4. value="{{ common.getValue(value, 'radio') }}"
  5. iconPosition="{{ iconPosition || 'right' }}"
  6. bind:change="onValueChange"
  7. wx:if="{{ !multiple }}"
  8. >
  9. <block wx:for="{{ options }}" wx:for-item="option" wx:key="value" wx:if="{{ options.length > 0 }}">
  10. <wux-cell
  11. title="{{ option.title }}"
  12. hoverClass="none"
  13. data-group="{{ option.isGroup }}"
  14. wx:if="{{ option.isGroup }}"
  15. />
  16. <wux-radio
  17. wrapStyle="{{ option.isGroupOption ? { paddingLeft: 30 } : '' }}"
  18. prefixCls="{{ option.prefixCls || 'wux-radio' }}"
  19. cellPrefixCls="{{ option.cellPrefixCls || 'wux-cell' }}"
  20. selectablePrefixCls="{{ option.selectablePrefixCls || 'wux-selectable' }}"
  21. thumb="{{ option.thumb || '' }}"
  22. title="{{ option.title || '' }}"
  23. label="{{ option.label || '' }}"
  24. value="{{ option.value || '' }}"
  25. checked="{{ common.getChecked(value, option.value, 'radio') }}"
  26. disabled="{{ option.disabled }}"
  27. color="{{ option.color || 'balanced' }}"
  28. data-index="{{ index }}"
  29. data-group-option="{{ option.isGroupOption }}"
  30. wx:else
  31. />
  32. </block>
  33. </wux-radio-group>
  34. <wux-checkbox-group
  35. id="wux-select"
  36. value="{{ common.getValue(value) }}"
  37. iconPosition="{{ iconPosition || 'left' }}"
  38. bind:change="onValueChange"
  39. wx:else
  40. >
  41. <block wx:for="{{ options }}" wx:for-item="option" wx:key="value" wx:if="{{ options.length > 0 }}">
  42. <wux-cell
  43. title="{{ option.title }}"
  44. hoverClass="none"
  45. data-group="{{ option.isGroup }}"
  46. wx:if="{{ option.isGroup }}"
  47. />
  48. <wux-checkbox
  49. wrapStyle="{{ option.isGroupOption ? { paddingLeft: 30 } : '' }}"
  50. prefixCls="{{ option.prefixCls || 'wux-checkbox' }}"
  51. cellPrefixCls="{{ option.cellPrefixCls || 'wux-cell' }}"
  52. selectablePrefixCls="{{ option.selectablePrefixCls || 'wux-selectable' }}"
  53. title="{{ option.title || '' }}"
  54. label="{{ option.label || '' }}"
  55. extra="{{ option.extra || '' }}"
  56. value="{{ option.value || '' }}"
  57. checked="{{ common.getChecked(value, option.value) }}"
  58. disabled="{{ option.disabled }}"
  59. color="{{ option.color || 'balanced' }}"
  60. data-index="{{ index }}"
  61. data-group-option="{{ option.isGroupOption }}"
  62. wx:else
  63. />
  64. </block>
  65. </wux-checkbox-group>
  66. </scroll-view>
  67. <wxs src="../helpers/wxs/common.wxs" module="common" />