index.axml 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. <import-sjs
  2. from="./index.sjs"
  3. name="utils" />
  4. <ant-popup
  5. className="ant-modal {{ className || '' }}"
  6. style="{{ style || '' }}"
  7. maskClassName="{{ maskClassName }}"
  8. maskStyle="{{ maskStyle }}"
  9. visible="{{ visible }}"
  10. duration="{{ duration }}"
  11. position="center"
  12. animation="{{ animation }}"
  13. zIndex="{{ zIndex }}"
  14. destroyOnClose="{{ destroyOnClose }}"
  15. onClose="onMaskClose">
  16. <slot slot="content">
  17. <view
  18. class="ant-modal-body {{ bodyClassName || '' }}"
  19. style="{{ bodyStyle || '' }}">
  20. <slot name="header" />
  21. <slot name="title">
  22. <view
  23. a:if="{{ title }}"
  24. class="ant-modal-body-title">
  25. {{ title }}
  26. </view>
  27. </slot>
  28. <slot name="content">
  29. <view
  30. a:if="{{ content }}"
  31. class="ant-modal-body-content">
  32. {{ content }}
  33. </view>
  34. </slot>
  35. <slot name="footer">
  36. <view
  37. a:if="{{ type === 'focus' }}"
  38. class="ant-modal-body-footer-focus">
  39. <ant-button
  40. type="primary"
  41. className="ant-modal-body-footer-focus-primary"
  42. style="{{ primaryButtonStyle || '' }}"
  43. onTap="onPrimaryButtonTap">
  44. {{ primaryButtonText }}
  45. </ant-button>
  46. <view
  47. a:if="{{ secondaryButtonText }}"
  48. class="ant-modal-body-footer-focus-secondary"
  49. style="{{ secondaryButtonStyle || '' }}"
  50. onTap="onSecondaryButtonTap">
  51. {{ secondaryButtonText }}
  52. </view>
  53. <view
  54. a:if="{{ cancelButtonText }}"
  55. class="ant-modal-body-footer-focus-cancel"
  56. style="{{ cancelButtonStyle || '' }}"
  57. onTap="onCancelButtonTap">
  58. {{ cancelButtonText }}
  59. </view>
  60. </view>
  61. <view
  62. a:elif="{{ utils.getDirection(primaryButtonText, secondaryButtonText, cancelButtonText, type) === 'horizontal' }}"
  63. class="ant-modal-body-footer-horizontal">
  64. <view
  65. a:if="{{ cancelButtonText }}"
  66. class="ant-modal-body-footer-horizontal-cancel"
  67. style="{{ cancelButtonStyle || '' }}"
  68. onTap="onCancelButtonTap">
  69. {{ cancelButtonText }}
  70. </view>
  71. <view
  72. a:if="{{ secondaryButtonText }}"
  73. class="ant-modal-body-footer-horizontal-secondary"
  74. style="{{ secondaryButtonStyle || '' }}"
  75. onTap="onSecondaryButtonTap">
  76. {{ secondaryButtonText }}
  77. </view>
  78. <view
  79. a:if="{{ primaryButtonText }}"
  80. class="ant-modal-body-footer-horizontal-primary"
  81. style="{{ primaryButtonStyle || '' }}"
  82. onTap="onPrimaryButtonTap">
  83. {{ primaryButtonText }}
  84. </view>
  85. </view>
  86. <view
  87. a:elif="{{ utils.getDirection(primaryButtonText, secondaryButtonText, cancelButtonText, type) === 'vertical' }}"
  88. class="ant-modal-body-footer-vertical">
  89. <view
  90. a:if="{{ primaryButtonText }}"
  91. class="ant-modal-body-footer-vertical-primary"
  92. style="{{ primaryButtonStyle || '' }}"
  93. onTap="onPrimaryButtonTap">
  94. {{ primaryButtonText }}
  95. </view>
  96. <view
  97. a:if="{{ secondaryButtonText }}"
  98. class="ant-modal-body-footer-vertical-secondary"
  99. style="{{ secondaryButtonStyle || '' }}"
  100. onTap="onSecondaryButtonTap">
  101. {{ secondaryButtonText }}
  102. </view>
  103. <view
  104. a:if="{{ cancelButtonText }}"
  105. class="ant-modal-body-footer-vertical-cancel"
  106. style="{{ cancelButtonStyle || '' }}"
  107. onTap="onCancelButtonTap">
  108. {{ cancelButtonText }}
  109. </view>
  110. </view>
  111. </slot>
  112. </view>
  113. </slot>
  114. <ant-icon
  115. a:if="{{ type === 'focus' && closable }}"
  116. type="CloseOutline"
  117. onTap="onClose"
  118. className="ant-modal-close" />
  119. </ant-popup>