index.axml 2.7 KB

12345678910111213141516171819202122232425262728293031323334
  1. <view class='tabs-index {{className}}' style='{{style}}' ref='saveChildRef0'>
  2. <import-sjs from='./index.sjs' name='computed'>
  3. </import-sjs>
  4. <import-sjs from='../wxs/utils.sjs' name='utils'>
  5. </import-sjs>
  6. <view class="{{customClass}} {{ utils.bem('tabs', [type]) }}">
  7. <van-sticky disabled='{{ !sticky }}' z-index='{{ zIndex }}' offset-top='{{ offsetTop }}' container='{{ container }}' onScroll='onTouchScroll' ref='saveChildRef1'>
  8. <view class="{{ utils.bem('tabs__wrap', { scrollable }) }} {{ type === 'line' && border ? 'van-hairline--top-bottom' : '' }}">
  9. <slot name='nav-left'>
  10. </slot>
  11. <scroll-view scroll-x='{{ scrollable }}' scroll-with-animation=" " scroll-left='{{ scrollLeft }}' class="{{ utils.bem('tabs__scroll', [type]) }}" style="{{ color ? 'border-color: ' + color : '' }}">
  12. <view class="{{ utils.bem('tabs__nav', [type, { complete: !ellipsis }]) }} {{navClass}}" style='{{ computed.navStyle(color, type) }}'>
  13. <view a:if="{{ type === 'line' }}" class='van-tabs__line' style='{{ computed.lineStyle({ color, lineOffsetLeft, lineHeight, skipTransition, duration, lineWidth }) }}'>
  14. </view>
  15. <view a:for='{{ tabs }}' a:key='{{index}}' data-index='{{ index }}' class="{{ computed.tabClass(index === currentIndex, ellipsis) }} {{ utils.bem('tab', { active: index === currentIndex, disabled: item.disabled, complete: !ellipsis }) }}" style='{{ computed.tabStyle({ active: index === currentIndex, ellipsis, color, type, disabled: item.disabled, titleActiveColor, titleInactiveColor, swipeThreshold, scrollable }) }}' ref-numbers='{{ tabs }}' onTap='antmoveAction' data-antmove-tap='onTap'>
  16. <view class="{{ ellipsis ? 'van-ellipsis' : '' }}" style='{{ item.titleStyle }}'>
  17. {{ item.title }} <van-info a:if='{{ item.info !== null || item.dot }}' info='{{ item.info }}' dot='{{ item.dot }}' custom-class='van-tab__title__info' ref='saveChildRef2'>
  18. </van-info>
  19. </view>
  20. </view>
  21. </view>
  22. </scroll-view>
  23. <slot name='nav-right'>
  24. </slot>
  25. </view>
  26. </van-sticky>
  27. <view class='van-tabs__content' catchTouchStart='antmoveAction' data-antmove-touchstart='onTouchStart' catchTouchMove='antmoveAction' data-antmove-touchmove='onTouchMove' catchTouchEnd='antmoveAction' data-antmove-touchend='onTouchEnd' catchTouchCancel='antmoveAction' data-antmove-touchcancel='onTouchEnd'>
  28. <view class="{{ utils.bem('tabs__track', [{ animated }]) }} van-tabs__track" style='{{ computed.trackStyle({ duration, currentIndex, animated }) }}'>
  29. <slot>
  30. </slot>
  31. </view>
  32. </view>
  33. </view>
  34. </view>