toast.wxml 635 B

1234567891011121314151617
  1. <view class="tui-toast {{visible?'tui-toast-show':''}} {{content?'tui-toast-padding':''}} {{icon?'':'tui-unicon-padding'}}" style="width:{{wxs.getWidth(icon,content)}}">
  2. <image src="{{imgUrl}}" class="tui-toast-img" wx:if="{{icon}}"></image>
  3. <view class="tui-toast-text {{icon?'':'tui-unicon'}}">{{title}}</view>
  4. <view class="tui-toast-text tui-content-ptop" wx:if="{{content && icon}}">{{content}}</view>
  5. </view>
  6. <wxs module="wxs">
  7. module.exports = {
  8. getWidth: function(icon, content) {
  9. var width = "auto";
  10. if (icon) {
  11. width = content ? '420rpx' : '360rpx';
  12. }
  13. return width
  14. }
  15. }
  16. </wxs>