uni-swipe-action.vue 718 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <template>
  2. <view>
  3. <slot></slot>
  4. </view>
  5. </template>
  6. <script>
  7. /**
  8. * SwipeAction 滑动操作
  9. * @description 通过滑动触发选项的容器
  10. * @tutorial https://ext.dcloud.net.cn/plugin?id=181
  11. */
  12. export default {
  13. name:"UniSwipeAction",
  14. data() {
  15. return {};
  16. },
  17. provide() {
  18. return {
  19. swipeaction: this
  20. };
  21. },
  22. created() {
  23. this.children = [];
  24. },
  25. methods: {
  26. closeOther(vm) {
  27. if (this.openItem && this.openItem !== vm) {
  28. // #ifdef APP-VUE || H5 || MP-WEIXIN
  29. this.openItem.button.show = 'none'
  30. // #endif
  31. // #ifndef APP-VUE || H5 || MP-WEIXIN
  32. this.openItem.close()
  33. // #endif
  34. }
  35. this.openItem = vm
  36. }
  37. }
  38. };
  39. </script>
  40. <style></style>