vtabs.wxml 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <view class="weui-vtabs">
  2. <view class="weui-vtabs-bar__wrp {{tabBarClass}}">
  3. <scroll-view
  4. scroll-y
  5. class="weui-vtabs-bar__scrollview"
  6. scroll-into-view="weui-vtabs-item__{{currentView}}"
  7. >
  8. <view class="weui-vtabs-bar__content">
  9. <block wx:for="{{vtabs}}" wx:key="title">
  10. <view
  11. id="weui-vtabs-item__{{index}}"
  12. class="{{activeTab === index ? 'weui-vtabs-bar__activeitem' : ''}} weui-vtabs-bar__item"
  13. data-index="{{index}}"
  14. bindtap="handleTabClick"
  15. >
  16. <view class="weui-vtabs-bar__title {{activeTab === index ? activeClass : ''}}">
  17. <text class="">{{item.title}}</text>
  18. </view>
  19. </view>
  20. </block>
  21. </view>
  22. </scroll-view>
  23. </view>
  24. <view class="weui-vtabs-content__wrp">
  25. <scroll-view
  26. scroll-y
  27. class="weui-vtabs-content__scrollview"
  28. scroll-top="{{contentScrollTop}}"
  29. scroll-with-animation="{{animation}}"
  30. bindscroll="handleContentScroll"
  31. >
  32. <view class="weui-vtabs-content">
  33. <slot ></slot>
  34. </view>
  35. </scroll-view>
  36. </view>
  37. </view>
  38. <!--
  39. style="background-color: {{activeTab === index ? tabBarActiveBgColor : tabBarInactiveBgColor}}; color: {{activeTab === index ? tabBarActiveTextColor : tabBarInactiveTextColor}}; border-left-color: {{activeTab === index ? tabBarLineColor : tabBarInactiveBgColor}}" -->