swipe-cell.wxml 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <import src="../common/template/icon.wxml" />
  2. <wxs src="./swipe-cell.wxs" module="swipe"></wxs>
  3. <wxs src="../common/utils.wxs" module="_" />
  4. <view
  5. class="{{prefix}}-class {{classPrefix}}"
  6. style="{{_._style([style, customStyle])}}"
  7. data-key="cell"
  8. capture-bind:tap="onTap"
  9. bindtouchstart="{{disabled || swipe.startDrag}}"
  10. capture-bind:touchmove="{{disabled || swipe.onDrag}}"
  11. bindtouchend="{{disabled || swipe.endDrag}}"
  12. bindtouchcancel="{{disabled || swipe.endDrag}}"
  13. opened="{{opened}}"
  14. change:opened="{{swipe.onOpenedChange}}"
  15. leftWidth="{{leftWidth}}"
  16. rightWidth="{{rightWidth}}"
  17. change:leftWidth="{{swipe.initLeftWidth}}"
  18. change:rightWidth="{{swipe.initRightWidth}}"
  19. >
  20. <view id="wrapper">
  21. <view class="{{classPrefix}}__left" data-key="left">
  22. <slot name="left" />
  23. <view
  24. wx:for="{{left}}"
  25. class="{{classPrefix}}__content {{language[item.className]||item.className}}"
  26. style="{{item.style}}"
  27. wx:key="index"
  28. data-action="{{item}}"
  29. bind:tap="onActionTap"
  30. >
  31. <template
  32. wx:if="{{item.icon}}"
  33. is="icon"
  34. data="{{class: classPrefix + '__icon', name: item.icon, ...item.icon}}"
  35. ></template>
  36. <text wx:if="{{item.text}}" class="{{classPrefix}}__text">{{item.text}}</text>
  37. </view>
  38. </view>
  39. <slot />
  40. <view class="{{classPrefix}}__right" data-key="right">
  41. <slot name="right" />
  42. <view
  43. wx:for="{{right}}"
  44. class="{{classPrefix}}__content {{language[item.className]||item.className}}"
  45. style="{{item.style}}"
  46. wx:key="index"
  47. data-action="{{item}}"
  48. bind:tap="onActionTap"
  49. >
  50. <template
  51. wx:if="{{item.icon}}"
  52. is="icon"
  53. data="{{class: classPrefix + '__icon', name: item.icon, ...item.icon}}"
  54. ></template>
  55. <text wx:if="{{item.text}}" class="{{classPrefix}}__text">{{item.text}}</text>
  56. </view>
  57. </view>
  58. </view>
  59. </view>