From 7223d4791bd959dbfb10617cc39a8481b9e4e3f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=8E=E8=82=96=E7=A3=8A?= <18851179580@163.com> Date: Fri, 14 Feb 2025 10:31:20 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=80=89=E9=A1=B9=E5=8D=A1?= =?UTF-8?q?=E5=86=85=E5=AE=B9=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/diy/modules/tabs-view.vue | 29 +++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/components/diy/modules/tabs-view.vue b/components/diy/modules/tabs-view.vue index f9c10cb4..37dc16a2 100644 --- a/components/diy/modules/tabs-view.vue +++ b/components/diy/modules/tabs-view.vue @@ -305,19 +305,22 @@ tabs_height: ['2', '4'].includes(new_content.tabs_theme) ? height * 2 + 'rpx' : '100%;', tabs_adorn_img_style: this.get_tabs_adorn_img_style(new_style), }); - setTimeout(() => { - const query = uni.createSelectorQuery().in(this); - query.select('.interior-area-' + this.propKey) - .fields({ size: true, scrollOffset: true},(res) => { - if ((res || null) != null) { - const { scrollWidth, width } = res; - this.setData({ - is_out_of_range: scrollWidth <= width - }); - } - }) - .exec(); - }, 0) + // 只有居左居右的才重新获取dom + if (['center', 'right'].includes(this.form.justification)) { + setTimeout(() => { + const query = uni.createSelectorQuery().in(this); + query.select('.interior-area-' + this.propKey) + .fields({ size: true, scrollOffset: true},(res) => { + if ((res || null) != null) { + const { scrollWidth, width } = res; + this.setData({ + is_out_of_range: scrollWidth <= width + }); + } + }) + .exec(); + }, 0) + } }, get_tabs_adorn_img_style(new_style) { return radius_computer(new_style?.tabs_adorn_img_radius || this.old_radius) + `height: ${(new_style?.tabs_adorn_img_height || 10) * 2}rpx;${ new_style.is_tabs_adorn_img_background == '1' ? tabs_check.value : ''}`;