drawer.wxml 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. <wxs src="../common/utils.wxs" module="_" />
  2. <t-popup
  3. style="{{_._style([style, customStyle])}}"
  4. bind:visible-change="visibleChange"
  5. visible="{{visible}}"
  6. zIndex="{{zIndex}}"
  7. placement="{{placement == 'right' ? 'right' : 'left'}}"
  8. showOverlay="{{showOverlay}}"
  9. destroyOnClose="{{destroyOnClose}}"
  10. closeOnOverlayClick="{{closeOnOverlayClick}}"
  11. >
  12. <view class="{{classPrefix}}">
  13. <slot name="title" />
  14. <view wx:if="{{title}}" class="{{classPrefix}}__title">{{title}}</view>
  15. <scroll-view class="{{classPrefix}}__sidebar" scroll-y>
  16. <view
  17. class="{{classPrefix}}__sidebar-item"
  18. wx:for="{{items}}"
  19. wx:item="item"
  20. wx:key="index"
  21. data-item="{{item}}"
  22. data-index="{{index}}"
  23. bindtap="itemClick"
  24. >
  25. <view wx:if="{{item.icon}}" class="{{classPrefix}}__sidebar-item-icon">
  26. <t-icon name="{{item.icon}}" />
  27. </view>
  28. <view class="{{classPrefix}}__sidebar-item-title"> {{item.title}} </view>
  29. </view>
  30. </scroll-view>
  31. <view class="{{classPrefix}}__footer">
  32. <slot />
  33. <slot name="footer" />
  34. </view>
  35. </view>
  36. </t-popup>