index.wxml 1.4KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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. type="{{ integer ? 'number' : 'digit' }}"
  19. class="input-class {{ utils.bem('stepper__input', { disabled: disabled || disableInput }) }}"
  20. style="{{ computed.inputStyle({ buttonSize, inputWidth }) }}"
  21. value="{{ currentValue }}"
  22. focus="{{ focus }}"
  23. disabled="{{ disabled || disableInput }}"
  24. bindinput="onInput"
  25. bind:focus="onFocus"
  26. bind:blur="onBlur"
  27. />
  28. <view
  29. wx:if="{{ showPlus }}"
  30. data-type="plus"
  31. style="{{ computed.buttonStyle({ buttonSize }) }}"
  32. class="plus-class {{ utils.bem('stepper__plus', { disabled: disabled || disablePlus || currentValue >= max }) }}"
  33. hover-class="van-stepper__plus--hover"
  34. hover-stay-time="70"
  35. bind:tap="onTap"
  36. bind:touchstart="onTouchStart"
  37. bind:touchend="onTouchEnd"
  38. >
  39. <slot name="plus" />
  40. </view>
  41. </view>