checkbox.wxml 1.6 KB

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