index.wxml 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. <wxs
  2. src="./index.wxs"
  3. module="util" />
  4. <view
  5. class="ant-selector {{ className ? className : '' }} {{ disabled ? 'ant-selector-disabled' : '' }}"
  6. style="{{ style }}">
  7. <view class="ant-selector-content-container">
  8. <block
  9. wx:for="{{ options }}"
  10. wx:for-index="index"
  11. wx:for-item="item">
  12. <view
  13. class="ant-selector-content {{ options.length <= 2 ? 'ant-selector-content-item2' : '' }}">
  14. <view
  15. class="ant-selector-item {{ item.disabled ? 'ant-selector-item-disabled' : '' }} {{ util.getChecked(item.value, mixin.value, multiple) ? 'ant-selector-item-active ' + (activeItemClassName || '') : '' }}"
  16. style="{{ util.getChecked(item.value, mixin.value, multiple) ? activeItemStyle || '' : '' }}"
  17. data-value="{{ item.value }}"
  18. data-disabled="{{ item.disabled }}"
  19. bind:tap="onChange">
  20. <view
  21. wx:if="{{ item.text }}"
  22. class="ant-selector-item-text">
  23. {{ item.text }}
  24. </view>
  25. <view
  26. wx:if="{{ item.subText }}"
  27. class="ant-selector-item-subtext">
  28. {{ item.subText }}
  29. </view>
  30. <view
  31. wx:if="{{ util.getChecked(item.value, mixin.value, multiple) }}"
  32. class="ant-selector-item-badge-active" />
  33. </view>
  34. </view>
  35. </block>
  36. </view>
  37. </view>