index.axml 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <view
  2. class="ant-indexbar-side {{className}}"
  3. disable-scroll="{{true}}"
  4. style="{{{ width: `${size}px;` }}} {{style}}"
  5. hover-stop-propagation>
  6. <view
  7. a:if="{{showMask}}"
  8. class="ant-indexbar-side-mask"></view>
  9. <view class="ant-indexbar-side-content">
  10. <view
  11. a:for="{{items}}"
  12. class="ant-indexbar-side-item"
  13. catchTouchStart="onTouchStart"
  14. catchTouchMove="onTouchMove"
  15. catchTouchEnd="onTouchEnd"
  16. data-item="{{item, index}}"
  17. id="{{'ant-alphabet-' + index}}"
  18. style="{{{ width: `${size}px`, height: `${size}px` }}}">
  19. <view
  20. style="{{{ width: `${size}px`, height: `${size}px` }}}"
  21. class="ant-indexbar-side-item-default {{activeClassName}}
  22. {{touchKey ? ((touchKey === item.label) ? 'ant-indexbar-side-active' : '') : (index === currentKey ? 'ant-indexbar-side-active' : '')}}">
  23. {{item.label}}
  24. </view>
  25. <view
  26. class="ant-indexbar-side-item-tip"
  27. a:if="{{item.label === touchKey && !item.disablePreview}}">
  28. {{item.label}}
  29. <slot
  30. value="{{item}}"
  31. index="{{index}}"
  32. name="labelPreview" />
  33. </view>
  34. </view>
  35. </view>
  36. </view>
  37. <scroll-view
  38. a:if="{{ hasDefaultSlot }}"
  39. scroll-y
  40. class="ant-indexbar-side-scroll {{hasDefaultSlot && topRange.length === 0 ? 'ant-indexbar-side-notSee' : ''}}"
  41. scroll-into-view="{{`ant-indexbar-${touchKey}`}}"
  42. onScroll="onScroll">
  43. <view
  44. a:for="{{items}}"
  45. class="ant-indexbar-side-list"
  46. id="{{`ant-indexbar-${item.label}`}}">
  47. <slot
  48. value="{{item}}"
  49. index="{{index}}" />
  50. </view>
  51. </scroll-view>