57 lines
1.8 KiB
Plaintext
57 lines
1.8 KiB
Plaintext
<wxs src="./message.wxs" module="this"></wxs>
|
|
<import src="../common/template/icon.wxml" />
|
|
|
|
<block wx:if="{{visible}}">
|
|
<view
|
|
class="{{classPrefix}} {{prefix}}-class {{classPrefix}}--{{theme}}"
|
|
style="{{this.getMessageStyles(zIndex, offset, wrapTop, customStyle)}}"
|
|
animation="{{showAnimation}}"
|
|
id="{{classPrefix}}"
|
|
aria-role="alert"
|
|
>
|
|
<view wx:if="{{iconName || !this.isEmptyObj(iconData)}}" class="{{classPrefix}}__icon--left">
|
|
<slot wx:if="{{iconName === 'slot'}}" name="icon" />
|
|
<template
|
|
wx:else
|
|
is="icon"
|
|
data="{{tClass: prefix + '-class-icon', ariaHidden: true, name: iconName, ...iconData}}"
|
|
></template>
|
|
</view>
|
|
|
|
<view
|
|
class="{{classPrefix}}__text-wrap {{marquee ? '{{classPrefix}}__text-nowrap' : ''}}"
|
|
style="text-align: {{align}}"
|
|
id="{{classPrefix}}__text-wrap"
|
|
>
|
|
<view class="{{classPrefix}}__text {{prefix}}-class-content" id="{{classPrefix}}__text" animation="{{animation}}">
|
|
<block wx:if="{{content}}">{{content}}</block>
|
|
<slot name="content"></slot>
|
|
</view>
|
|
</view>
|
|
|
|
<t-button
|
|
wx:if="{{action}}"
|
|
t-class="{{classPrefix}}__btn--right {{prefix}}-class-action"
|
|
theme="primary"
|
|
variant="text"
|
|
size="small"
|
|
bind:tap="handleBtnClick"
|
|
>{{action}}</t-button
|
|
>
|
|
<slot name="action" />
|
|
|
|
<view
|
|
wx:if="{{ closeBtnName || !this.isEmptyObj(closeBtnData)}}"
|
|
class="{{classPrefix}}__icon--right"
|
|
bind:tap="handleClose"
|
|
>
|
|
<slot wx:if="{{closeBtnName === 'slot'}}" name="close-btn" />
|
|
<template
|
|
wx:else
|
|
is="icon"
|
|
data="{{tClass: prefix + '-class-close-btn', ariaRole: 'button', ariaLabel: '关闭', name: closeBtnName, ...closeBtnData}}"
|
|
></template>
|
|
</view>
|
|
</view>
|
|
</block>
|