swipe-cell.wxml 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <wxs src="./swipe-cell.wxs" module="swipe"></wxs>
  2. <view
  3. class="{{prefix}}-class {{classPrefix}}"
  4. data-key="cell"
  5. capture-bind:tap="onTap"
  6. bindtouchstart="{{disabled || swipe.startDrag}}"
  7. capture-bind:touchmove="{{disabled || swipe.onDrag}}"
  8. bindtouchend="{{disabled || swipe.endDrag}}"
  9. bindtouchcancel="{{disabled || swipe.endDrag}}"
  10. opened="{{opened}}"
  11. change:opened="{{swipe.onOpenedChange}}"
  12. leftWidth="{{leftWidth}}"
  13. rightWidth="{{rightWidth}}"
  14. change:leftWidth="{{swipe.initLeftWidth}}"
  15. change:rightWidth="{{swipe.initRightWidth}}"
  16. >
  17. <view id="wrapper">
  18. <view class="{{classPrefix}}__left" data-key="left">
  19. <slot name="left" />
  20. <view
  21. wx:for="{{left}}"
  22. class="{{item.className}}"
  23. style="{{item.style}}"
  24. wx:key="index"
  25. data-action="{{item}}"
  26. bind:tap="onActionTap"
  27. >
  28. {{item.text}}
  29. </view>
  30. </view>
  31. <slot />
  32. <view class="{{classPrefix}}__right" data-key="right">
  33. <slot name="right" />
  34. <view
  35. wx:for="{{right}}"
  36. class="{{item.className}}"
  37. style="{{item.style}}"
  38. wx:key="index"
  39. data-action="{{item}}"
  40. bind:tap="onActionTap"
  41. >
  42. {{item.text}}
  43. </view>
  44. </view>
  45. </view>
  46. </view>