indexes.wxml 892 B

12345678910111213141516171819202122232425
  1. <wxs src="../common/utils.wxs" module="_" />
  2. <view style="{{_._style([style, customStyle])}}" class="{{classPrefix}} {{prefix}}-class">
  3. <view
  4. class="{{classPrefix}}__sidebar {{prefix}}-class-sidebar"
  5. id="id-{{classPrefix}}__bar"
  6. catch:touchmove="onTouchMove"
  7. catch:touchcancel="onTouchCancel"
  8. catch:touchend="onTouchEnd"
  9. >
  10. <view
  11. class="{{_.cls(classPrefix + '__sidebar-item', [['active', activeAnchor === item]])}} {{prefix}}-class-sidebar-item"
  12. wx:for="{{ _indexList }}"
  13. wx:key="index"
  14. bind:tap="onClick"
  15. data-index="{{index}}"
  16. >
  17. <view aria-role="button" aria-label="{{ activeAnchor === item ? '已选中' + item : ''}}"> {{ item }} </view>
  18. <view class="{{classPrefix}}__sidebar-tips" wx:if="{{ showTips && activeAnchor === item }}">
  19. {{ activeAnchor }}
  20. </view>
  21. </view>
  22. </view>
  23. <slot />
  24. </view>