From b9c7920b766cf0da935dfbf49b15646bdfaaf8b0 Mon Sep 17 00:00:00 2001 From: marvzhang Date: Thu, 28 Nov 2019 12:54:56 +0800 Subject: [PATCH] =?UTF-8?q?fixed=20=E9=85=8D=E7=BD=AE=E4=B8=8B=E5=88=92?= =?UTF-8?q?=E7=BA=BF=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 --- frontend/src/components/Config/ConfigList.vue | 10 ++++++++++ frontend/src/views/spider/SpiderDetail.vue | 8 ++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/frontend/src/components/Config/ConfigList.vue b/frontend/src/components/Config/ConfigList.vue index 7b7c7ffd..1c127ca3 100644 --- a/frontend/src/components/Config/ConfigList.vue +++ b/frontend/src/components/Config/ConfigList.vue @@ -538,6 +538,16 @@ export default { }, onTabClick (tab) { this.activeTab = tab.name + }, + update () { + if (this.activeTab !== 'stages') return + + // 手动显示tab下划线 + const elBar = document.querySelector('.el-tabs__active-bar') + const elStages = document.querySelector('#tab-stages') + const totalWidth = Number(getComputedStyle(elStages).width.replace('px', '')) + const paddingRight = Number(getComputedStyle(elStages).paddingRight.replace('px', '')) + elBar.setAttribute('style', 'width:' + (totalWidth - paddingRight) + 'px') } }, created () { diff --git a/frontend/src/views/spider/SpiderDetail.vue b/frontend/src/views/spider/SpiderDetail.vue index b42e750d..29b531ef 100644 --- a/frontend/src/views/spider/SpiderDetail.vue +++ b/frontend/src/views/spider/SpiderDetail.vue @@ -13,8 +13,8 @@ - - + + @@ -77,6 +77,10 @@ export default { setTimeout(() => { this.$refs['spider-stats'].update() }, 0) + } else if (this.activeTabName === 'config') { + setTimeout(() => { + this.$refs['config'].update() + }, 0) } this.$st.sendEv('爬虫详情', '切换标签', tab.name) },