checkbox.wxml 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <view class="{{classPrefix}} {{prefix}}-class {{classPrefix}}--{{align}}">
  2. <!-- icon -->
  3. <view
  4. class="{{classPrefix}}__icon-{{align}} {{prefix}}-class-icon"
  5. data-target="icon"
  6. bind:tap="onChange"
  7. >
  8. <block wx:if="{{icon.length > 0}}">
  9. <view class="{{classPrefix}}__icon">
  10. <image src="{{active ? icon[0] : icon[1]}}" class="{{classPrefix}}__icon-image" webp />
  11. </view>
  12. </block>
  13. <block wx:else>
  14. <t-icon
  15. color="{{active && !disabled ? color : ''}}"
  16. name="{{active ? (halfChecked ? 'minus-circle-filled' : 'check-circle-filled') : 'circle'}}"
  17. class="{{classPrefix}}__btn {{active ? prefix + '-is-checked' : ''}} {{disabled ? prefix + '-is-disabled' : ''}}"
  18. />
  19. </block>
  20. </view>
  21. <!-- 文本内容 -->
  22. <view
  23. class="{{classPrefix}}__content {{disabled ? prefix + '-is-disabled' : ''}}"
  24. data-target="text"
  25. bind:tap="onChange"
  26. >
  27. <!-- title -->
  28. <view
  29. class="{{classPrefix}}__title {{prefix}}-class-label"
  30. style="-webkit-line-clamp:{{maxLabelRow}}"
  31. >
  32. {{label}}
  33. <slot name="label" />
  34. </view>
  35. <!-- content -->
  36. <view
  37. class="{{classPrefix}}__description {{prefix}}-class-content "
  38. style="-webkit-line-clamp:{{maxContentRow}}"
  39. >
  40. {{content}}
  41. <slot />
  42. <slot name="content" />
  43. </view>
  44. </view>
  45. <!-- 内置下边框 -->
  46. <view
  47. class="{{classPrefix}}__border {{classPrefix}}__border--{{align}} {{prefix}}-class-border"
  48. />
  49. </view>