dialog.wxml 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <import src="../common/template/button.wxml" />
  2. <import src="../common/template/icon.wxml" />
  3. <wxs src="../common/utils.wxs" module="_" />
  4. <wxs src="./dialog.wxs" module="_this" />
  5. <t-popup
  6. name="dialog"
  7. style="{{_._style([style, customStyle])}}"
  8. class="class"
  9. t-class="{{classPrefix}}__wrapper"
  10. visible="{{visible}}"
  11. showOverlay="{{showOverlay}}"
  12. closeOnOverlayClick="{{closeOnOverlayClick}}"
  13. preventScrollThrough="{{preventScrollThrough}}"
  14. overlayProps="{{overlayProps}}"
  15. zIndex="{{zIndex}}"
  16. placement="center"
  17. usingCustomNavbar="{{usingCustomNavbar}}"
  18. bind:visible-change="overlayClick"
  19. >
  20. <view slot="content" class="{{classPrefix}} {{prefix}}-class">
  21. <slot name="top" />
  22. <view wx:if="{{closeBtn}}" class="{{classPrefix}}__close-btn" bind:tap="onClose">
  23. <template wx:if="{{_.isObject(closeBtn)}}" is="icon" data="{{ name: 'close', size: 22, ...closeBtn }}" />
  24. <t-icon wx:else name="close" size="44rpx" />
  25. </view>
  26. <view class="{{classPrefix}}__content {{prefix}}-class-content">
  27. <view wx:if="{{title}}" class="{{classPrefix}}__header">{{title}}</view>
  28. <slot name="title" />
  29. <view wx:if="{{content}}" class="{{classPrefix}}__body">
  30. <text class="{{classPrefix}}__body-text">{{content}}</text>
  31. </view>
  32. <slot name="content" />
  33. </view>
  34. <slot name="middle" />
  35. <view
  36. class="{{_.cls(classPrefix + '__footer', [['column', buttonLayout === 'vertical'], ['full', buttonVariant == 'text' && actions.length == 0]])}}"
  37. >
  38. <block wx:if="{{actions}}">
  39. <block wx:for="{{actions}}" wx:key="index">
  40. <template
  41. is="button"
  42. data="{{block: true, type: 'action', extra: index, tClass: prefix + '-class-action', rootClass: _this.getActionClass(classPrefix, buttonLayout), ...item }}"
  43. />
  44. </block>
  45. </block>
  46. <slot name="actions" />
  47. <block wx:if="{{_cancel}}">
  48. <template is="button" data="{{type: 'cancel', ..._cancel }}" />
  49. </block>
  50. <slot name="cancel-btn" />
  51. <block wx:if="{{_confirm}}">
  52. <template is="button" data="{{type: 'confirm', theme: 'primary', ..._confirm}}" />
  53. </block>
  54. <slot name="confirm-btn" />
  55. </view>
  56. </view>
  57. </t-popup>