index.axml 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. <import-sjs
  2. from="./index.sjs"
  3. name="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. a:for="{{ options }}"
  10. a:for-index="index"
  11. a: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. onTap="onChange">
  20. <view
  21. a:if="{{ item.text }}"
  22. class="ant-selector-item-text">
  23. {{ item.text }}
  24. </view>
  25. <view
  26. a:if="{{ item.subText }}"
  27. class="ant-selector-item-subtext">
  28. {{ item.subText }}
  29. </view>
  30. <view
  31. a:if="{{ util.getChecked(item.value, mixin.value, multiple) }}"
  32. class="ant-selector-item-badge-active" />
  33. <slot item="{{ item }}" />
  34. </view>
  35. </view>
  36. </block>
  37. </view>
  38. </view>