From a475a91d289a5a3c1b793cdb3dc6e6cb2c30a438 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=98=89=E8=B1=AA?= <42510293+ziyujiahao@users.noreply.github.com> Date: Thu, 2 Apr 2026 11:46:22 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20tab=E9=A1=B5=E9=9A=90=E8=97=8F?= =?UTF-8?q?=E5=90=8E=EF=BC=8C=E4=B8=8D=E5=8F=82=E4=B8=8E=E8=BD=AE=E6=92=AD?= =?UTF-8?q?=20(#18185)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../custom-component/de-tabs/Component.vue | 9 ++++- .../de-tabs/CustomTabsSortSide.vue | 40 +++++++++++++++---- 2 files changed, 40 insertions(+), 9 deletions(-) diff --git a/core/core-frontend/src/custom-component/de-tabs/Component.vue b/core/core-frontend/src/custom-component/de-tabs/Component.vue index 39408ba548..20e1957d26 100644 --- a/core/core-frontend/src/custom-component/de-tabs/Component.vue +++ b/core/core-frontend/src/custom-component/de-tabs/Component.vue @@ -703,15 +703,20 @@ const initCarousel = () => { if (!isEditMode.value) { if (element.value.carousel?.enable) { const switchTime = (element.value.carousel.time || 5) * 1000 + // 过滤出可见的标签页 + const visibleTabs = element.value.propValue.filter(tab => !tab.hidden) + + // 如果没有可见的标签页,则不启动轮播 + if (visibleTabs.length === 0) return let switchCount = 1 // 轮播定时器 carouselTimer = setInterval(() => { // 鼠标移入时 停止轮播 if (!state.hoverFlag) { - const nowIndex = switchCount % element.value.propValue.length + const nowIndex = switchCount % visibleTabs.length switchCount++ nextTick(() => { - element.value.editableTabsValue = element.value.propValue[nowIndex].name + element.value.editableTabsValue = visibleTabs[nowIndex].name }) } }, switchTime) diff --git a/core/core-frontend/src/custom-component/de-tabs/CustomTabsSortSide.vue b/core/core-frontend/src/custom-component/de-tabs/CustomTabsSortSide.vue index 879721b3d5..f6db0da9c5 100644 --- a/core/core-frontend/src/custom-component/de-tabs/CustomTabsSortSide.vue +++ b/core/core-frontend/src/custom-component/de-tabs/CustomTabsSortSide.vue @@ -27,15 +27,11 @@ - + @@ -50,7 +46,7 @@