popup.wxml 1.5 KB

123456789101112131415161718192021222324252627282930313233343536
  1. <wxs src="./popup.wxs" module="popup" />
  2. <wxs src="../common/utils.wxs" module="_" />
  3. <view
  4. wx:if="{{realVisible}}"
  5. style="{{_._style([popup.getPopupStyles(zIndex, distanceTop, placement), style, customStyle])}}"
  6. class="{{_.cls(classPrefix, [placement])}} {{transitionClass}} class {{prefix}}-class"
  7. bind:transitionend="onTransitionEnd"
  8. >
  9. <!-- 暂时移除:aria-role="dialog" aria-modal="{{ true }}",关联:https://github.com/Tencent/tdesign-miniprogram/issues/2142 -->
  10. <view
  11. data-prevention="{{preventScrollThrough || (overlayProps ? !!overlayProps.preventScrollThrough : false)}}"
  12. bind:touchmove="{{popup.onContentTouchMove}}"
  13. class="{{classPrefix}}__content {{prefix}}-class-content"
  14. >
  15. <slot name="content" />
  16. <slot />
  17. <view class="{{classPrefix}}__close" bind:tap="handleClose">
  18. <t-icon name="close" wx:if="{{closeBtn}}" size="64rpx" />
  19. <slot name="close-btn" class="{{classPrefix}}-slot" />
  20. </view>
  21. </view>
  22. </view>
  23. <t-overlay
  24. id="popup-overlay"
  25. wx:if="{{showOverlay}}"
  26. visible="{{visible}}"
  27. usingCustomNavbar="{{usingCustomNavbar}}"
  28. z-index="{{overlayProps && overlayProps.zIndex || 11000}}"
  29. duration="{{overlayProps && overlayProps.duration || 300}}"
  30. background-color="{{overlayProps && overlayProps.backgroundColor || ''}}"
  31. prevent-scroll-through="{{preventScrollThrough || (overlayProps ? !!overlayProps.preventScrollThrough : false)}}"
  32. bind:tap="handleOverlayClick"
  33. custom-style="{{overlayProps && overlayProps.style || ''}}"
  34. />