From 45f67659d9c22cc18437f4fe1a1f97eb6c76bdfa Mon Sep 17 00:00:00 2001
From: whycq <913841844@qq.com>
Date: 星期三, 16 八月 2023 22:16:13 +0800
Subject: [PATCH] #
---
uni_modules/uni-swipe-action/components/uni-swipe-action/uni-swipe-action.vue | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 60 insertions(+), 0 deletions(-)
diff --git a/uni_modules/uni-swipe-action/components/uni-swipe-action/uni-swipe-action.vue b/uni_modules/uni-swipe-action/components/uni-swipe-action/uni-swipe-action.vue
new file mode 100644
index 0000000..4971782
--- /dev/null
+++ b/uni_modules/uni-swipe-action/components/uni-swipe-action/uni-swipe-action.vue
@@ -0,0 +1,60 @@
+<template>
+ <view>
+ <slot></slot>
+ </view>
+</template>
+
+<script>
+ /**
+ * SwipeAction 婊戝姩鎿嶄綔
+ * @description 閫氳繃婊戝姩瑙﹀彂閫夐」鐨勫鍣�
+ * @tutorial https://ext.dcloud.net.cn/plugin?id=181
+ */
+ export default {
+ name:"uniSwipeAction",
+ data() {
+ return {};
+ },
+ created() {
+ this.children = [];
+ },
+ methods: {
+ // 鍏紑缁欑敤鎴蜂娇鐢紝閲嶅埗缁勪欢鏍峰紡
+ resize(){
+ // wxs 浼氳嚜宸辫绠楃粍浠跺ぇ灏忥紝鎵�浠ユ棤闇�鎵ц涓嬮潰浠g爜
+ // #ifndef APP-VUE || H5 || MP-WEIXIN
+ this.children.forEach(vm=>{
+ vm.init()
+ })
+ // #endif
+ },
+ // 鍏紑缁欑敤鎴蜂娇鐢紝鍏抽棴鍏ㄩ儴 宸茬粡鎵撳紑鐨勭粍浠�
+ closeAll(){
+ this.children.forEach(vm=>{
+ // #ifdef APP-VUE || H5 || MP-WEIXIN
+ vm.is_show = 'none'
+ // #endif
+
+ // #ifndef APP-VUE || H5 || MP-WEIXIN
+ vm.close()
+ // #endif
+ })
+ },
+ closeOther(vm) {
+ if (this.openItem && this.openItem !== vm) {
+ // #ifdef APP-VUE || H5 || MP-WEIXIN
+ this.openItem.is_show = 'none'
+ // #endif
+
+ // #ifndef APP-VUE || H5 || MP-WEIXIN
+ this.openItem.close()
+ // #endif
+ }
+ // 璁板綍涓婁竴涓墦寮�鐨� swipe-action-item ,鐢ㄤ簬 auto-close
+ this.openItem = vm
+ }
+ }
+ };
+</script>
+
+<style></style>
--
Gitblit v1.9.1