water_xcx/miniprogram_npm/tdesign-miniprogram/toast/toast.wxml

37 lines
1.3 KiB
Plaintext
Raw Normal View History

2025-04-15 15:44:51 +08:00
<view
wx:if="{{realVisible}}"
class="{{classPrefix}} {{prefix}}-class {{transitionClass}} {{classPrefix}}--{{direction}}"
style="top: {{placement === 'top' ? '25%' : placement === 'bottom' ? '75%': '45%'}}"
bind:transitionend="onTransitionEnd"
>
<view class="{{classPrefix}}__content {{classPrefix}}__content--{{direction}}">
<t-icon
wx:if="{{typeMapIcon!=='loading' || icon}}"
name="{{typeMapIcon || icon}}"
class="{{classPrefix}}__icon {{classPrefix}}__icon--{{direction}}"
color="#fff"
size="{{direction === 'row' ? '42rpx' : '96rpx'}}"
/>
<t-loading
wx:if="{{typeMapIcon === 'loading'}}"
theme="circular"
size="{{direction === 'row' ? '42rpx' : '96rpx'}}"
loading
inherit-color
style="color: white"
layout="vertical"
/>
<slot name="icon" />
<view class="{{classPrefix}}__text {{typeMapIcon || icon ? classPrefix + '__text--' + direction : ''}}"
>{{message}}</view
>
<slot name="message" />
</view>
</view>
<t-overlay
visible="{{realVisible && (showOverlay || preventScrollThrough)}}"
z-index="{{overlayProps.zIndex}}"
backgroundColor="{{preventScrollThrough ? 'transparent' : overlayProps.backgroundColor}}"
preventScrollThrough="{{preventScrollThrough || overlayProps.preventScrollThrough}}"
/>