index.axml 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. <import-sjs
  2. from="./index.sjs"
  3. name="{getDirection}" />
  4. <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"></slot>
  21. <slot name="title">
  22. <view
  23. class="ant-modal-body-title"
  24. a:if="{{ title }}">
  25. {{title}}
  26. </view>
  27. </slot>
  28. <slot name="content">
  29. <view
  30. class="ant-modal-body-content"
  31. a:if="{{ 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. <button
  40. type="primary"
  41. class="ant-modal-body-footer-focus-primary"
  42. style="{{primaryButtonStyle || ''}}"
  43. onTap="onPrimaryButtonTap">
  44. {{primaryButtonText}}
  45. </button>
  46. <view
  47. class="ant-modal-body-footer-focus-secondary"
  48. a:if="{{secondaryButtonText}}"
  49. style="{{secondaryButtonStyle || ''}}"
  50. onTap="onSecondaryButtonTap">
  51. {{secondaryButtonText}}
  52. </view>
  53. <view
  54. class="ant-modal-body-footer-focus-cancel"
  55. a:if="{{cancelButtonText}}"
  56. style="{{cancelButtonStyle || ''}}"
  57. onTap="onCancelButtonTap">
  58. {{cancelButtonText}}
  59. </view>
  60. </view>
  61. <view
  62. a:elif="{{ getDirection(primaryButtonText,secondaryButtonText,cancelButtonText,type) === 'horizontal' }}"
  63. class="ant-modal-body-footer-horizontal">
  64. <view
  65. class="ant-modal-body-footer-horizontal-cancel"
  66. a:if="{{cancelButtonText}}"
  67. style="{{cancelButtonStyle || ''}}"
  68. onTap="onCancelButtonTap">
  69. {{cancelButtonText}}
  70. </view>
  71. <view
  72. class="ant-modal-body-footer-horizontal-secondary"
  73. a:if="{{secondaryButtonText}}"
  74. style="{{secondaryButtonStyle || ''}}"
  75. onTap="onSecondaryButtonTap">
  76. {{secondaryButtonText}}
  77. </view>
  78. <view
  79. class="ant-modal-body-footer-horizontal-primary"
  80. a:if="{{primaryButtonText}}"
  81. style="{{primaryButtonStyle || ''}}"
  82. onTap="onPrimaryButtonTap">
  83. {{primaryButtonText}}
  84. </view>
  85. </view>
  86. <view
  87. a:elif="{{ getDirection(primaryButtonText,secondaryButtonText,cancelButtonText,type) === 'vertical' }}"
  88. class="ant-modal-body-footer-vertical">
  89. <view
  90. class="ant-modal-body-footer-vertical-primary"
  91. a:if="{{primaryButtonText}}"
  92. style="{{primaryButtonStyle || ''}}"
  93. onTap="onPrimaryButtonTap">
  94. {{primaryButtonText}}
  95. </view>
  96. <view
  97. class="ant-modal-body-footer-vertical-secondary"
  98. a:if="{{secondaryButtonText}}"
  99. style="{{secondaryButtonStyle || ''}}"
  100. onTap="onSecondaryButtonTap">
  101. {{secondaryButtonText}}
  102. </view>
  103. <view
  104. class="ant-modal-body-footer-vertical-cancel"
  105. a:if="{{cancelButtonText}}"
  106. style="{{cancelButtonStyle || ''}}"
  107. onTap="onCancelButtonTap">
  108. {{cancelButtonText}}
  109. </view>
  110. </view>
  111. </slot>
  112. </view>
  113. </slot>
  114. <icon
  115. a:if="{{ type==='focus' && closable }}"
  116. type="CloseOutline"
  117. onTap="onClose"
  118. className="ant-modal-close" />
  119. </popup>