swiper.wxml 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <wxs src="./swiper.wxs" module="swiper" />
  2. <!-- 支持传入height指定容器高度,单位rpx -->
  3. <view
  4. id="swiper"
  5. class="{{prefix}}-class {{classPrefix}}"
  6. style="{{height?'height:'+height+'rpx':''}}"
  7. >
  8. <view
  9. id="swiperContainer"
  10. class="{{classPrefix}}__container {{inited? '{{prefix}}-in-animation' : '{{prefix}}-is-hidden'}}"
  11. style="transition-duration: {{duration/1000}}s;transition-timing-function:{{easings.linear}};"
  12. bindtouchstart="{{swiper.startDrag}}"
  13. capture-catch:touchmove="{{swiper.onDrag}}"
  14. bindtouchend="{{swiper.endDrag}}"
  15. bindtouchcancel="{{swiper.endDrag}}"
  16. offsetX="{{offsetX}}"
  17. offsetY="{{offsetY}}"
  18. width="{{_width}}"
  19. height="{{_height}}"
  20. direction="{{direction}}"
  21. total="{{total}}"
  22. currentInited="{{currentInited}}"
  23. change:offsetX="{{swiper.changeOffsetX}}"
  24. change:offsetY="{{swiper.changeOffsetY}}"
  25. change:width="{{swiper.changeWidth}}"
  26. change:height="{{swiper.changeHeight}}"
  27. change:direction="{{swiper.changeDirection}}"
  28. change:total="{{swiper.changeTotal}}"
  29. change:currentInited="{{swiper.changeCurrentInited}}"
  30. >
  31. <slot />
  32. </view>
  33. <t-swiper-nav
  34. id="swiperNav"
  35. wx:if="{{_navigation}}"
  36. type="{{_navigation.type}}"
  37. minShowNum="{{_navigation.minShowNum}}"
  38. hasNavBtn="{{_navigation.hasNavBtn}}"
  39. bind:navBtnChange="onSwiperNavBtnChange"
  40. />
  41. <!-- 同时支持插槽组合 -->
  42. <slot name="nav" />
  43. </view>