uni-swipe-action.vue 693 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  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. data() {
  14. return {};
  15. },
  16. provide() {
  17. return {
  18. swipeaction: this
  19. };
  20. },
  21. created() {
  22. this.children = [];
  23. },
  24. methods: {
  25. closeOther(vm) {
  26. if (this.openItem && this.openItem !== vm) {
  27. // #ifdef APP-VUE || H5 || MP-WEIXIN
  28. this.openItem.button.show = 'none'
  29. // #endif
  30. // #ifndef APP-VUE || H5 || MP-WEIXIN
  31. this.openItem.close()
  32. // #endif
  33. }
  34. this.openItem = vm
  35. }
  36. }
  37. };
  38. </script>
  39. <style></style>