toast.wxml 1.3 KB

123456789101112131415161718192021222324252627282930313233343536
  1. <view
  2. wx:if="{{realVisible}}"
  3. class="{{classPrefix}} {{prefix}}-class {{transitionClass}} {{classPrefix}}--{{direction}}"
  4. style="top: {{placement === 'top' ? '25%' : placement === 'bottom' ? '75%': '45%'}}"
  5. bind:transitionend="onTransitionEnd"
  6. >
  7. <view class="{{classPrefix}}__content {{classPrefix}}__content--{{direction}}">
  8. <t-icon
  9. wx:if="{{typeMapIcon!=='loading' || icon}}"
  10. name="{{typeMapIcon || icon}}"
  11. class="{{classPrefix}}__icon {{classPrefix}}__icon--{{direction}}"
  12. color="#fff"
  13. size="{{direction === 'row' ? '42rpx' : '96rpx'}}"
  14. />
  15. <t-loading
  16. wx:if="{{typeMapIcon === 'loading'}}"
  17. theme="circular"
  18. size="{{direction === 'row' ? '42rpx' : '96rpx'}}"
  19. loading
  20. inherit-color
  21. style="color: white"
  22. layout="vertical"
  23. />
  24. <slot name="icon" />
  25. <view class="{{classPrefix}}__text {{typeMapIcon || icon ? classPrefix + '__text--' + direction : ''}}"
  26. >{{message}}</view
  27. >
  28. <slot name="message" />
  29. </view>
  30. </view>
  31. <t-overlay
  32. visible="{{realVisible && (showOverlay || preventScrollThrough)}}"
  33. z-index="{{overlayProps.zIndex}}"
  34. backgroundColor="{{preventScrollThrough ? 'transparent' : overlayProps.backgroundColor}}"
  35. preventScrollThrough="{{preventScrollThrough || overlayProps.preventScrollThrough}}"
  36. />