From 913ac49ce1d90808baa5c1ae1a944bcd43c93bfd Mon Sep 17 00:00:00 2001
From: sws <1141121512@qq.com>
Date: Tue, 22 Oct 2024 11:09:27 +0800
Subject: [PATCH] =?UTF-8?q?1.=E6=94=AF=E4=BB=98=E5=AE=9D=E5=B0=8F=E7=A8=8B?=
=?UTF-8?q?=E5=BA=8F=E5=85=BC=E5=AE=B9=E6=80=A7=E4=BC=98=E5=8C=96?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
components/diy/diy.vue | 42 ++++++++++++++++++------------------
components/diy/nav-group.vue | 10 ++++-----
2 files changed, 26 insertions(+), 26 deletions(-)
diff --git a/components/diy/diy.vue b/components/diy/diy.vue
index ff1668b6..21243944 100644
--- a/components/diy/diy.vue
+++ b/components/diy/diy.vue
@@ -16,29 +16,29 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
-
-
-
-
-
+
+
+
+
+
diff --git a/components/diy/nav-group.vue b/components/diy/nav-group.vue
index f71bef7d..73d29316 100644
--- a/components/diy/nav-group.vue
+++ b/components/diy/nav-group.vue
@@ -3,7 +3,7 @@
-
+
@@ -46,7 +46,7 @@
},
},
propKey: {
- type: [String,Number],
+ type: [String, Number],
default: '',
},
// 组件渲染的下标
@@ -102,11 +102,11 @@
nav_style: new_content.nav_style || 'image_with_text', // 是否显示文字和图片
nav_content_list: this.get_nav_content_list(new_content),
});
- setTimeout(() => {
+ this.$nextTick(() => {
const query = uni.createSelectorQuery().in(this);
// 选择我们想要的元素
query
- .select('.banner-img')
+ .select('.banner-img-' + this.propKey)
.boundingClientRect((res) => {
if ((res || null) != null) {
// data包含元素的宽度、高度等信息
@@ -116,7 +116,7 @@
}
})
.exec(); // 执行查询
- }, 0);
+ });
},
get_nav_content_list(data) {
// 深拷贝一下,确保不会出现问题