index.wxml 1.3 KB

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