index.wxml 530 B

12345678910111213141516171819202122
  1. <view class="van-index-bar">
  2. <slot />
  3. <view
  4. wx:if="{{ showSidebar }}"
  5. class="van-index-bar__sidebar"
  6. catch:tap="onClick"
  7. catch:touchmove="onTouchMove"
  8. catch:touchend="onTouchStop"
  9. catch:touchcancel="onTouchStop"
  10. >
  11. <view
  12. wx:for="{{ indexList }}"
  13. wx:key="index"
  14. class="van-index-bar__index"
  15. style="z-index: {{ zIndex + 1 }}; color: {{ activeAnchorIndex === index ? highlightColor : '' }}"
  16. data-index="{{ index }}"
  17. >
  18. {{ item }}
  19. </view>
  20. </view>
  21. </view>