virtual-select-menu.wxml 3.4 KB

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