index.wxml 1015 B

12345678910111213141516171819202122232425262728
  1. <template name="zan-quantity">
  2. <view class="zan-quantity {{ size === 'small' ? 'zan-quantity--small' : '' }}">
  3. <view
  4. class="zan-quantity__minus {{ quantity <= min ? 'zan-quantity--disabled' : '' }}"
  5. data-component-id="{{ componentId }}"
  6. data-quantity="{{ quantity }}"
  7. data-disabled="{{ quantity <= min }}"
  8. bindtap="_handleZanQuantityMinus"
  9. >-</view>
  10. <input
  11. class="zan-quantity__text {{ min >= max ? 'zan-quantity--disabled' : '' }}"
  12. type="number"
  13. data-component-id="{{ componentId }}"
  14. data-min="{{ min }}"
  15. data-max="{{ max }}"
  16. value="{{ quantity }}"
  17. disabled="{{ min >= max }}"
  18. bindblur="_handleZanQuantityBlur"
  19. ></input>
  20. <view
  21. class="zan-quantity__plus {{ quantity >= max ? 'zan-quantity--disabled' : '' }}"
  22. data-component-id="{{ componentId }}"
  23. data-quantity="{{ quantity }}"
  24. data-disabled="{{ quantity >= max }}"
  25. bindtap="_handleZanQuantityPlus"
  26. >+</view>
  27. </view>
  28. </template>