message.wxml 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <wxs src="./message.wxs" module="this"></wxs>
  2. <block wx:if="{{visible}}">
  3. <view
  4. class="{{classPrefix}} {{prefix}}-class {{classPrefix}}--{{theme}}"
  5. style="z-index: {{zIndex}};{{this.getMessageStylesOffset({ offset })}};transform: translateY({{wrapTop}}px)"
  6. animation="{{showAnimation}}"
  7. id="{{classPrefix}}"
  8. >
  9. <t-icon
  10. wx:if="{{iconName}}"
  11. name="{{iconName}}"
  12. class="{{classPrefix}}__icon--left {{prefix}}-class-icon"
  13. size="44rpx"
  14. />
  15. <slot name="icon" />
  16. <view
  17. class="{{classPrefix}}__text-wrap {{marquee ? '{{classPrefix}}__text-nowrap' : ''}}"
  18. style="text-align: {{align}}"
  19. id="{{classPrefix}}__text-wrap"
  20. >
  21. <view
  22. class="{{classPrefix}}__text {{prefix}}-class-content"
  23. id="{{classPrefix}}__text"
  24. animation="{{animation}}"
  25. >
  26. <view wx:if="{{content}}">{{content}}</view>
  27. <slot name="content"></slot>
  28. </view>
  29. </view>
  30. <t-button
  31. wx:if="{{action}}"
  32. t-class="{{classPrefix}}__btn--right {{prefix}}-class-action"
  33. size="small"
  34. bind:tap="handleBtnClick"
  35. >{{action}}</t-button
  36. >
  37. <slot name="action" />
  38. <t-icon
  39. wx:if="{{closeBtn}}"
  40. class="{{classPrefix}}__icon--right {{prefix}}-class-close-btn"
  41. name="close"
  42. size="20px"
  43. bind:tap="handleClose"
  44. />
  45. <slot name="closeBtn" />
  46. </view>
  47. </block>