tabs.wxml 1.1 KB

1234567891011121314151617181920212223242526272829303132
  1. <wxs src="./tabs.wxs" module="filters" />
  2. <view class="{{prefix}}-class {{classPrefix}} {{classPrefix}}--{{placement}}">
  3. <scroll-view class="{{classPrefix}}__scroll" enable-flex scroll-x="{{isScrollX}}" scroll-y="{{isScrollY}}">
  4. <view class="{{classPrefix}}__nav">
  5. <view
  6. wx:for="{{tabs}}"
  7. wx:key="index"
  8. data-index="{{index}}"
  9. class="{{classPrefix}}__item {{prefix}}-class-item {{item.disabled ? (prefix + '-is-disabled') : '' }} {{currentIndex === index ? prefix + '-is-active ' + prefix + '-class-active' : ''}}"
  10. bind:tap="onTabTap"
  11. >
  12. {{item.label}}
  13. <slot name="label" />
  14. </view>
  15. <view class="{{classPrefix}}__track {{prefix}}-class-track" style="{{trackStyle}}" />
  16. </view>
  17. </scroll-view>
  18. <view
  19. class="{{classPrefix}}__content"
  20. bind:touchstart="onTouchStart"
  21. bind:touchmove="onTouchMove"
  22. bind:touchend="onTouchEnd"
  23. bind:touchcancel="onTouchEnd"
  24. >
  25. <view
  26. class="{{classPrefix}}__content-inner "
  27. style="{{ filters.animate({duration: animate.duration,currentIndex:currentIndex, direction}) }}"
  28. >
  29. <slot />
  30. </view>
  31. </view>
  32. </view>