index.wxml 811 B

123456789101112131415161718192021222324252627282930
  1. <wxs src="../wxs/utils.wxs" module="utils" />
  2. <wxs src="../wxs/style.wxs" module="style" />
  3. <view
  4. class="custom-class {{ utils.bem('slider', { disabled }) }}"
  5. style="{{ style({ background: inactiveColor, height: utils.addUnit(barHeight) }) }}"
  6. bind:tap="onClick"
  7. >
  8. <view
  9. class="{{ utils.bem('slider__bar') }}"
  10. style="{{ barStyle }}; {{ style({ backgroundColor: activeColor }) }}"
  11. >
  12. <view
  13. class="{{ utils.bem('slider__button-wrapper') }}"
  14. bind:touchstart="onTouchStart"
  15. catch:touchmove="onTouchMove"
  16. bind:touchend="onTouchEnd"
  17. bind:touchcancel="onTouchEnd"
  18. >
  19. <slot
  20. wx:if="{{ useButtonSlot }}"
  21. name="button"
  22. />
  23. <view
  24. wx:else
  25. class="{{ utils.bem('slider__button') }}"
  26. />
  27. </view>
  28. </view>
  29. </view>