From 1e61215b48e59e94c1ed98e4ef956227d689d6bc Mon Sep 17 00:00:00 2001
From: quanyawei <401863037@qq.com>
Date: Mon, 06 Nov 2023 08:48:39 +0800
Subject: [PATCH] fix:小程序订阅消息

---
 uni_modules/uview-ui/components/u-swipe-action/u-swipe-action.vue |   67 +++++++++++++++++++++++++++++++++
 1 files changed, 67 insertions(+), 0 deletions(-)

diff --git a/uni_modules/uview-ui/components/u-swipe-action/u-swipe-action.vue b/uni_modules/uview-ui/components/u-swipe-action/u-swipe-action.vue
new file mode 100644
index 0000000..ad8f019
--- /dev/null
+++ b/uni_modules/uview-ui/components/u-swipe-action/u-swipe-action.vue
@@ -0,0 +1,67 @@
+<template>
+	<view class="u-swipe-action">
+		<slot></slot>
+	</view>
+</template>
+
+<script>
+	import props from './props.js';
+	/**
+	 * SwipeAction ��������������� 
+	 * @description ���������������������������������������������������������������������������������������������
+	 * @tutorial https://www.uviewui.com/components/swipeAction.html
+	 * @property {Boolean}	autoClose	������������������������swipe���������
+	 * @event {Function(index)}	click	���������������������
+	 * @example	<u-swipe-action><u-swipe-action-item :rightOptions="options1" ></u-swipe-action-item></u-swipe-action>
+	 */
+	export default {
+		name: 'u-swipe-action',
+		mixins: [uni.$u.mpMixin, uni.$u.mixin, props],
+		data() {
+			return {}
+		},
+		provide() {
+			return {
+				swipeAction: this
+			}
+		},
+		computed: {
+			// ������computed���������������������������u-swipe-action-item���������������������������������������������������������������������������������������������������������������
+			// ������������������������������������������������������parentData������������watch���������������������������������������������������������������(u-swipe-action-item)
+			// ���������������������������������������
+			parentData() {
+				return [this.autoClose]
+			}
+		},
+		watch: {
+			// ���������������������������������������������������������������������������������������
+			parentData() {
+				if (this.children.length) {
+					this.children.map(child => {
+						// ���������������(u-swipe-action-item)���������updateParentData���������������������������(������������������������������������������������������������������)
+						typeof(child.updateParentData) === 'function' && child.updateParentData()
+					})
+				}
+			},
+		},
+		created() {
+			this.children = []
+		},
+		methods: {
+			closeOther(child) {
+				if (this.autoClose) {
+					// ������������������������������������������������������������������������������
+					this.children.map((item, index) => {
+						if (child !== item) {
+							item.closeHandler()
+						}
+					})
+				}
+			}
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+
+</style>

--
Gitblit v1.8.0