mirror of
https://github.com/crawlab-team/crawlab.git
synced 2026-01-22 17:31:03 +01:00
fixed 配置下划线不显示的问题
This commit is contained in:
@@ -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 () {
|
||||
|
||||
@@ -13,8 +13,8 @@
|
||||
<el-tab-pane :label="$t('Overview')" name="overview">
|
||||
<spider-overview/>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane v-if="isConfigurable" :label="$t('Config')" name="配置">
|
||||
<config-list/>
|
||||
<el-tab-pane v-if="isConfigurable" :label="$t('Config')" name="config">
|
||||
<config-list ref="config"/>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane :label="$t('Files')" name="files">
|
||||
<file-list/>
|
||||
@@ -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)
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user