From 2cc85c64f1c64a2dbaeae276a3e2ca8420de76b7 Mon Sep 17 00:00:00 2001
From: WXL <wl_5969728@163.com>
Date: 星期三, 22 四月 2026 18:09:58 +0800
Subject: [PATCH] 上报转运调试
---
node_modules/@dcloudio/uni-ui/lib/uni-collapse/uni-collapse.vue | 28 ++++++++++++++--------------
1 files changed, 14 insertions(+), 14 deletions(-)
diff --git a/node_modules/@dcloudio/uni-ui/lib/uni-collapse/uni-collapse.vue b/node_modules/@dcloudio/uni-ui/lib/uni-collapse/uni-collapse.vue
index 384c39a..f42690f 100644
--- a/node_modules/@dcloudio/uni-ui/lib/uni-collapse/uni-collapse.vue
+++ b/node_modules/@dcloudio/uni-ui/lib/uni-collapse/uni-collapse.vue
@@ -51,8 +51,11 @@
}
},
watch: {
- dataValue(val) {
- this.setOpen(val)
+ dataValue: {
+ handler(newVal) {
+ this.setOpen(newVal)
+ },
+ deep: true
}
},
created() {
@@ -66,9 +69,9 @@
},
methods: {
setOpen(val) {
- let str = typeof val === 'string'
- let arr = Array.isArray(val)
- this.childrens.forEach((vm, index) => {
+ const str = typeof val === 'string'
+ const arr = Array.isArray(val)
+ this.childrens.forEach((vm) => {
if (str) {
if (val === vm.nameSync) {
if (!this.accordion) {
@@ -79,15 +82,12 @@
}
}
if (arr) {
- val.forEach(v => {
- if (v === vm.nameSync) {
- if (this.accordion) {
- console.warn('accordion 灞炴�т负 true ,v-model 绫诲瀷搴旇涓� string')
- return
- }
- vm.isOpen = true
- }
- })
+ const isOpen = val.findIndex(v => v === vm.nameSync) !== -1
+ if (this.accordion && isOpen) {
+ console.warn('accordion 灞炴�т负 true ,v-model 绫诲瀷搴旇涓� string')
+ return
+ }
+ vm.isOpen = isOpen
}
})
this.emit(val)
--
Gitblit v1.9.3