From 39e226c4e413215304347dba7d28a8dc22496c85 Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Tue, 29 Nov 2022 21:15:04 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix(=E4=BB=AA=E8=A1=A8=E6=9D=BF):=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BB=AA=E8=A1=A8=E6=9D=BF=E4=B8=AD=E5=85=B6?= =?UTF-8?q?=E4=BB=96=E7=BB=84=E4=BB=B6=E6=8B=96=E5=85=A5Tab=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E9=A1=B5=E9=9D=A2=E4=B8=8D=E5=8F=AF=E7=94=A8=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/components/widget/deWidget/DeTabs.vue | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/frontend/src/components/widget/deWidget/DeTabs.vue b/frontend/src/components/widget/deWidget/DeTabs.vue index 511b907769..2f28c3a9f1 100644 --- a/frontend/src/components/widget/deWidget/DeTabs.vue +++ b/frontend/src/components/widget/deWidget/DeTabs.vue @@ -202,9 +202,7 @@ Date: Tue, 29 Nov 2022 22:18:44 +0800 Subject: [PATCH 2/2] =?UTF-8?q?fix(=E4=BB=AA=E8=A1=A8=E6=9D=BF):=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8DTab=E7=BB=84=E4=BB=B6=E5=8A=A0=E8=BF=87?= =?UTF-8?q?=E6=BB=A4=E5=99=A8=E8=BD=AE=E6=92=AD=E8=A7=86=E5=9B=BE=E5=8F=AF?= =?UTF-8?q?=E8=83=BD=E4=B8=8D=E6=98=BE=E7=A4=BA=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/widget/deWidget/DeTabs.vue | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/frontend/src/components/widget/deWidget/DeTabs.vue b/frontend/src/components/widget/deWidget/DeTabs.vue index 2f28c3a9f1..c4c2ad52a3 100644 --- a/frontend/src/components/widget/deWidget/DeTabs.vue +++ b/frontend/src/components/widget/deWidget/DeTabs.vue @@ -464,15 +464,20 @@ export default { } }, initCarousel() { - this.timer && clearInterval(this.timer) - if (this.element.style.carouselEnable) { - const switchTime = (this.element.style.switchTime || 5) * 1000 + const _this = this + _this.timer && clearInterval(_this.timer) + if (_this.element.style.carouselEnable) { + const switchTime = (_this.element.style.switchTime || 5) * 1000 let switchCount = 1 // 轮播定时器 - this.timer = setInterval(() => { - const nowIndex = switchCount % this.element.options.tabList.length + _this.timer = setInterval(() => { + const nowIndex = switchCount % _this.element.options.tabList.length switchCount++ - this.activeTabName = this.element.options.tabList[nowIndex].name + _this.activeTabName = _this.element.options.tabList[nowIndex].name + const targetRef = _this.$refs['canvasTabRef-' + _this.activeTabName] + if (targetRef) { + targetRef[0].restore() + } }, switchTime) } },