index.wxml 1.6 KB

12345678910111213141516171819202122232425262728
  1. <view
  2. class="wux-class {{ classes.wrap }}"
  3. data-selector-value="{{ inputValue }}"
  4. data-selector-col-value="{{ fieldNames.value }}"
  5. data-selector-col-label="{{ fieldNames.label }}"
  6. style="{{ extStyle }}"
  7. >
  8. <view class="{{ classes.grid }}">
  9. <block wx:for="{{ common.getOptions(options, fieldNames) }}" wx:for-item="option" wx:key="__comp_unique_key">
  10. <view class="{{ classes.gridItem }} {{ common.getChecked(inputValue, option[fieldNames.value]) ? prefixCls + '__grid-item--current' : '' }} {{ !!option[fieldNames.disabled] ? prefixCls + '__grid-item--disabled' : '' }}" aria-role="option" aria-selected="{{ common.getChecked(inputValue, option[fieldNames.value]) }}">
  11. <text>{{ option[fieldNames.label] }}</text>
  12. <view class="{{ classes.desc }}" wx:if="{{ option.desc }}">{{ option.desc }}</view>
  13. <view class="{{ classes.checkMark }}" wx:if="{{ showCheckMark }}">
  14. <icon class="{{ classes.checkMarkIcon }}" type="success_no_circle" size="7" color="#fff" />
  15. </view>
  16. <wux-selectable
  17. wux-class="{{ classes.selectable }}"
  18. value="{{ option[fieldNames.value] || '' }}"
  19. checked="{{ common.getChecked(inputValue, option[fieldNames.value]) }}"
  20. disabled="{{ !!option[fieldNames.disabled] }}"
  21. controlled
  22. bind:change="onCheckboxChange"
  23. />
  24. </view>
  25. </block>
  26. </view>
  27. </view>
  28. <wxs src="../helpers/wxs/common.wxs" module="common" />