action-sheet.wxml 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <wxs src="./action-sheet.wxs" module="_this" />
  2. <wxs src="../common/utils.wxs" module="_" />
  3. <import src="./template/list.wxml" />
  4. <import src="./template/grid.wxml" />
  5. <view id="{{classPrefix}}" style="{{_._style([style, customStyle])}}" class="{{classPrefix}} class {{prefix}}-class">
  6. <t-popup
  7. visible="{{visible}}"
  8. placement="bottom"
  9. usingCustomNavbar="{{usingCustomNavbar}}"
  10. bind:visible-change="onPopupVisibleChange"
  11. show-overlay="{{showOverlay}}"
  12. z-index="{{ popupProps.zIndex || defaultPopUpzIndex }}"
  13. overlay-props="{{ popupProps.overlayProps || defaultPopUpProps }}"
  14. >
  15. <view
  16. class="{{_.cls(classPrefix + '__content', [['grid', gridThemeItems.length]])}} {{prefix}}-class-content"
  17. tabindex="0"
  18. >
  19. <view wx:if="{{description}}" tabindex="0" class="{{_.cls(classPrefix + '__description', [align])}}"
  20. >{{description}}</view
  21. >
  22. <block wx:if="{{gridThemeItems.length}}">
  23. <template is="grid" data="{{classPrefix, prefix, gridThemeItems, count, currentSwiperIndex}}" />
  24. </block>
  25. <view wx:elif="{{items && items.length}}" class="{{classPrefix}}__list">
  26. <block wx:for="{{ items }}" wx:key="index">
  27. <template
  28. is="list"
  29. data="{{index, classPrefix, listThemeItemClass: _.cls(classPrefix + '__list-item', [align, [disabled, item.disabled]]), item}}"
  30. />
  31. </block>
  32. </view>
  33. </view>
  34. <slot />
  35. <view wx:if="{{showCancel}}" class="{{classPrefix}}__footer">
  36. <view class="{{classPrefix}}__gap-{{theme}}" />
  37. <view
  38. class="{{classPrefix}}__cancel {{prefix}}-class-cancel"
  39. hover-class="{{classPrefix}}__cancel--hover"
  40. hover-stay-time="70"
  41. bind:tap="onCancel"
  42. aria-role="button"
  43. >
  44. {{ cancelText || '取消' }}
  45. </view>
  46. </view>
  47. </t-popup>
  48. </view>