message.wxml 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <wxs src="./message.wxs" module="this"></wxs>
  2. <wxs src="../common/utils.wxs" module="_" />
  3. <import src="../common/template/icon.wxml" />
  4. <block wx:if="{{visible}}">
  5. <view
  6. class="{{classPrefix}} class {{prefix}}-class {{classPrefix}}--{{theme}}"
  7. style="{{_._style([this.getMessageStyles(zIndex, offset, wrapTop), style, customStyle])}}"
  8. animation="{{showAnimation}}"
  9. id="{{classPrefix}}"
  10. aria-role="alert"
  11. >
  12. <view class="{{classPrefix}}__icon--left">
  13. <slot name="icon" />
  14. <template wx:if="{{_icon}}" is="icon" data="{{tClass: prefix + '-class-icon', ariaHidden: true, ..._icon }}" />
  15. </view>
  16. <view
  17. class="{{classPrefix}}__text-wrap {{marquee ? '{{classPrefix}}__text-nowrap' : ''}}"
  18. style="text-align: {{align}}"
  19. id="{{classPrefix}}__text-wrap"
  20. >
  21. <view class="{{classPrefix}}__text {{prefix}}-class-content" id="{{classPrefix}}__text" animation="{{animation}}">
  22. <block wx:if="{{content}}">{{content}}</block>
  23. <slot name="content" />
  24. <slot />
  25. </view>
  26. </view>
  27. <t-link
  28. wx:if="{{_link.content}}"
  29. class="{{classPrefix}}__link {{prefix}}-class-link"
  30. style="{{_._style([_link.style, _link.customStyle])}}"
  31. disabled="{{_link.disabled || false}}"
  32. hover="{{_link.hover || true}}"
  33. theme="{{_link.theme || 'primary'}}"
  34. size="{{_link.size || 'medium'}}"
  35. prefixIcon="{{_link.prefixIcon || false}}"
  36. suffixIcon="{{_link.suffixIcon || false}}"
  37. underline="{{_link.underline || false}}"
  38. content="{{_link.content || ''}}"
  39. navigatorProps="{{_link.navigatorProps || null}}"
  40. bind:complete="handleLinkClick"
  41. />
  42. <slot name="link" />
  43. <view class="{{classPrefix}}__icon--right" bind:tap="handleClose">
  44. <slot name="close-btn" />
  45. <template
  46. wx:if="{{_closeBtn}}"
  47. is="icon"
  48. data="{{tClass: prefix + '-class-close-btn', ariaRole: 'button', ariaLabel: '关闭', ..._closeBtn }}"
  49. />
  50. </view>
  51. </view>
  52. </block>