index.wxml 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <wxs src="../wxs/utils.wxs" module="utils" />
  2. <wxs src="./index.wxs" module="computed" />
  3. <view class="{{ utils.bem('stepper', [theme]) }} custom-class">
  4. <view
  5. wx:if="{{ showMinus }}"
  6. data-type="minus"
  7. style="{{ computed.buttonStyle({ buttonSize }) }}"
  8. class="minus-class {{ utils.bem('stepper__minus', { disabled: disabled || disableMinus || currentValue <= min }) }}"
  9. hover-class="van-stepper__minus--hover"
  10. hover-stay-time="70"
  11. bind:tap="onTap"
  12. bind:touchstart="onTouchStart"
  13. bind:touchend="onTouchEnd"
  14. >
  15. <slot name="minus" />
  16. </view>
  17. <input
  18. always-embed="{{ false }}"
  19. type="{{ integer ? 'number' : 'digit' }}"
  20. class="input-class {{ utils.bem('stepper__input', { disabled: disabled || disableInput }) }}"
  21. style="{{ computed.inputStyle({ buttonSize, inputWidth }) }}"
  22. value="{{ currentValue }}"
  23. focus="{{ focus }}"
  24. disabled="{{ disabled || disableInput }}"
  25. always-embed="{{ alwaysEmbed }}"
  26. bindinput="onInput"
  27. bind:focus="onFocus"
  28. bind:blur="onBlur"
  29. />
  30. <view
  31. wx:if="{{ showPlus }}"
  32. data-type="plus"
  33. style="{{ computed.buttonStyle({ buttonSize }) }}"
  34. class="plus-class {{ utils.bem('stepper__plus', { disabled: disabled || disablePlus || currentValue >= max }) }}"
  35. hover-class="van-stepper__plus--hover"
  36. hover-stay-time="70"
  37. bind:tap="onTap"
  38. bind:touchstart="onTouchStart"
  39. bind:touchend="onTouchEnd"
  40. >
  41. <slot name="plus" />
  42. </view>
  43. </view>