stepper.wxml 1.5 KB

12345678910111213141516171819202122232425262728293031323334
  1. <wxs src="../common/utils.wxs" module="_" />
  2. <view style="{{_._style([style, customStyle])}}" class="{{classPrefix}} {{classPrefix}}--{{size}} {{prefix}}-class">
  3. <view
  4. class="{{classPrefix}}__minus {{classPrefix}}__minus--{{theme}} {{classPrefix}}__icon--{{size}} {{ disabled || disableMinus || currentValue <= min ? classPrefix + '--' + theme + '-disabled': ''}} {{prefix}}-class-minus"
  5. catchtap="minusValue"
  6. aria-label="{{'减少' + step}}"
  7. aria-role="button"
  8. aria-disabled="{{disabled || disableMinus || currentValue <= min}}"
  9. >
  10. <t-icon name="remove" class="{{classPrefix}}__minus-icon" />
  11. </view>
  12. <view class="{{classPrefix}}__input--{{theme}} {{ disabled ? classPrefix + '--' + theme + '-disabled': ''}}">
  13. <input
  14. style="{{inputWidth? 'width:' + inputWidth + 'px;': ''}}"
  15. class="{{classPrefix}}__input {{classPrefix}}__input--{{size}} {{prefix}}-class-input"
  16. disabled="{{ disabled || disableInput }}"
  17. type="number"
  18. value="{{ currentValue }}"
  19. catchinput="inputHandle"
  20. catchfocus="focusHandle"
  21. catchblur="blurHandle"
  22. />
  23. </view>
  24. <view
  25. class="{{classPrefix}}__plus {{classPrefix}}__plus--{{theme}} {{classPrefix}}__icon--{{size}} {{ disabled || disablePlus|| currentValue >= max ? classPrefix + '--' + theme + '-disabled': ''}} {{prefix}}-class-plus"
  26. catchtap="plusValue"
  27. aria-label="{{'增加' + step}}"
  28. aria-role="button"
  29. aria-disabled="{{disabled || disablePlus|| currentValue >= max}}"
  30. >
  31. <t-icon name="add" class="{{classPrefix}}__plus-icon" />
  32. </view>
  33. </view>