From 16213c0f85aa3ac8317797bf4a05fd12940e16d3 Mon Sep 17 00:00:00 2001
From: zhangwei <1504152376@qq.com>
Date: 星期三, 05 三月 2025 17:29:42 +0800
Subject: [PATCH] -

---
 src/uni_modules/uview-plus/components/u-swipe-action-item/u-swipe-action-item.vue |   33 +++++++++++++++++++++++++++------
 1 files changed, 27 insertions(+), 6 deletions(-)

diff --git a/src/uni_modules/uview-plus/components/u-swipe-action-item/u-swipe-action-item.vue b/src/uni_modules/uview-plus/components/u-swipe-action-item/u-swipe-action-item.vue
index 73afb4d..d655166 100644
--- a/src/uni_modules/uview-plus/components/u-swipe-action-item/u-swipe-action-item.vue
+++ b/src/uni_modules/uview-plus/components/u-swipe-action-item/u-swipe-action-item.vue
@@ -90,8 +90,7 @@
 	 */
 	export default {
 		name: 'u-swipe-action-item',
-		emits: ['click'],
-		
+		emits: ['click', 'update:show'],
 		mixins: [
 			mpMixin,
 			mixin,
@@ -101,7 +100,7 @@
 			// #ifdef APP-NVUE
 			nvue,
 			// #endif
-			// #ifdef APP-VUE || MP-WEIXIN || H5 || MP-QQ || H5
+			// #ifdef APP-VUE || MP-WEIXIN || MP-QQ || H5
 			wxs,
 			// #endif
 			// #ifdef MP-ALIPAY || MP-BAIDU || MP-TOUTIAO
@@ -118,7 +117,7 @@
 					autoClose: true,
 				},
 				// 褰撳墠鐘舵�侊紝open-鎵撳紑锛宑lose-鍏抽棴
-				status: 'close',
+				status: '',
 				sliderStyle: {}
 			}
 		},
@@ -127,8 +126,23 @@
 			// #ifndef APP-NVUE
 			wxsInit(newValue, oldValue) {
 				this.queryRect()
-			}
+			},
 			// #endif
+			status(newValue) {
+				if (newValue === 'open') {
+					this.$emit('update:show', true)
+					this.parent && this.parent.setOpendItem(this)
+				} else {
+					this.$emit('update:show', false)
+				}
+			},
+			show(newValue) {
+				if (newValue) {
+					this.status = 'open'
+				} else {
+					this.status = 'close'
+				}
+			}
 		},
 		computed: {
 			wxsInit() {
@@ -137,6 +151,9 @@
 		},
 		mounted() {
 			this.init()
+		},
+		beforeUmount() {
+			this.closeHandler()
 		},
 		methods: {
 			addUnit,
@@ -170,10 +187,14 @@
 			// #endif
 			// 鎸夐挳琚偣鍑�
 			buttonClickHandler(item, index) {
-				this.$emit('click', {
+				let ret = this.$emit('click', {
 					index,
 					name: this.name
+				}, () => {
 				})
+				if (this.closeOnClick) {
+					this.closeHandler()
+				}
 			}
 		},
 	}

--
Gitblit v1.9.1