radio.wxml 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. <view class="{{classPrefix}} {{prefix}}-class {{classPrefix}}--{{align}}">
  2. <!-- 图标 -->
  3. <view
  4. class="{{classPrefix}}__icon {{classPrefix}}__icon--{{align}} {{prefix}}-class-icon"
  5. data-target="icon"
  6. bind:tap="handleTap"
  7. >
  8. <view wx:if="{{customIcon}}" class="{{classPrefix}}__image">
  9. <image src="{{active ? iconVal[0] : iconVal[1]}}" class="{{classPrefix}}-icon__image" webp />
  10. </view>
  11. <t-icon
  12. wx:elif="{{active && iconVal[0] || !active && iconVal[1]}}"
  13. color="{{active && !disabled ? color : ''}}"
  14. name="{{active ? iconVal[0] : iconVal[1]}}"
  15. class="{{classPrefix}}__btn {{disabled ? classPrefix + '-is-disabled' : ''}} {{active ? classPrefix + '-is-checked' : ''}}"
  16. />
  17. </view>
  18. <!-- 文本内容 -->
  19. <view
  20. class="{{classPrefix}}__content {{disabled ? classPrefix + '__content--disabled' : ''}}"
  21. data-target="text"
  22. bind:tap="handleTap"
  23. >
  24. <!-- 主文本 -->
  25. <view class="{{classPrefix}}__title {{prefix}}-class-label" style="-webkit-line-clamp:{{maxLabelRow}}">
  26. {{label}}
  27. <slot />
  28. </view>
  29. <!-- content -->
  30. <view class="{{classPrefix}}__description {{prefix}}-class-content " style="-webkit-line-clamp:{{maxContentRow}}">
  31. {{content}}
  32. </view>
  33. </view>
  34. <!-- 预制下边框 -->
  35. <view
  36. wx:if="{{!borderless}}"
  37. class="{{classPrefix}}__border {{classPrefix}}__border--{{align}} {{prefix}}-class-border"
  38. ></view>
  39. </view>