From 670d495ee2ad41e5da4a365aee6cd8f9107c0b61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=8E=E8=82=96=E7=A3=8A?= <18851179580@163.com> Date: Mon, 17 Feb 2025 09:52:15 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=80=89=E9=A1=B9=E5=8D=A1?= =?UTF-8?q?=E7=82=B9=E5=87=BB=E4=BD=8D=E7=BD=AE=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/diy/modules/tabs-view.vue | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/components/diy/modules/tabs-view.vue b/components/diy/modules/tabs-view.vue index e7edba0b..070bbe3c 100644 --- a/components/diy/modules/tabs-view.vue +++ b/components/diy/modules/tabs-view.vue @@ -400,7 +400,11 @@ .boundingClientRect((rect) => { const tabs_index = this.form.tabs_list.findIndex(item => item.is_sliding_fixed == '1'); // 如果第一个悬浮了,就取第二个的left加上 第一个的宽度和left - const new_width = tabs_index == 0 && index != 0 ? rect[1].left - rect[0].width - rect[0].left : rect[0].left; + let new_width = tabs_index == 0 && index != 0 ? rect[1].left - rect[0].width - rect[0].left : rect[0].left; + // 如果悬浮的不是第一个并且选中的是悬浮的内容 + if (index > 0 && tabs_index == index) { + new_width = rect[index + 1].left + rect[index].width + } const scrollLeft = rect[index].left + rect[index].width / 2 -