index.wxml 1.4 KB

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. always-embed="{{ alwaysEmbed }}"
  25. bindinput="onInput"
  26. bind:focus="onFocus"
  27. bind:blur="onBlur"
  28. />
  29. <view
  30. wx:if="{{ showPlus }}"
  31. data-type="plus"
  32. style="{{ computed.buttonStyle({ buttonSize }) }}"
  33. class="plus-class {{ utils.bem('stepper__plus', { disabled: disabled || disablePlus || currentValue >= max }) }}"
  34. hover-class="van-stepper__plus--hover"
  35. hover-stay-time="70"
  36. bind:tap="onTap"
  37. bind:touchstart="onTouchStart"
  38. bind:touchend="onTouchEnd"
  39. >
  40. <slot name="plus" />
  41. </view>
  42. </view>