From f55db37ec30bbf916e5efb24d6fb0945a9726180 Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Fri, 10 Jan 2025 16:06:22 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E4=BB=AA=E8=A1=A8=E6=9D=BF=E3=80=81?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=A4=A7=E5=B1=8F):=20tab=E8=BD=AE=E6=92=AD?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E9=BC=A0=E6=A0=87=E6=82=AC=E5=81=9C=E5=81=9C?= =?UTF-8?q?=E6=AD=A2=20#13838?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../custom-component/de-tabs/Component.vue | 33 +++++++++++++++---- 1 file changed, 26 insertions(+), 7 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 90ae30000c..e2cae86e6e 100644 --- a/core/core-frontend/src/custom-component/de-tabs/Component.vue +++ b/core/core-frontend/src/custom-component/de-tabs/Component.vue @@ -63,8 +63,10 @@
@@ -214,12 +216,20 @@ const { searchCount } = toRefs(props) +const handleMouseEnter = () => { + state.hoverFlag = true +} + +const handleMouseLeave = () => { + state.hoverFlag = false +} const state = reactive({ activeTabName: '', curItem: {}, textarea: '', dialogVisible: false, - tabShow: true + tabShow: true, + hoverFlag: false }) const tabsAreaScroll = ref(false) const editableTabsValue = ref(null) @@ -512,11 +522,14 @@ const initCarousel = () => { let switchCount = 1 // 轮播定时器 carouselTimer = setInterval(() => { - const nowIndex = switchCount % element.value.propValue.length - switchCount++ - nextTick(() => { - editableTabsValue.value = element.value.propValue[nowIndex].name - }) + // 鼠标移入时 停止轮播 + if (!state.hoverFlag) { + const nowIndex = switchCount % element.value.propValue.length + switchCount++ + nextTick(() => { + editableTabsValue.value = element.value.propValue[nowIndex].name + }) + } }, switchTime) } } @@ -611,4 +624,10 @@ onBeforeMount(() => { opacity: 0; z-index: -1; } + +.tab-content-custom { + position: absolute; + width: 100%; + height: 100%; +}