From e724a63f5bb4bed1950f931d7dbedb9c4171bfac Mon Sep 17 00:00:00 2001 From: zhangyu Date: Sat, 18 Sep 2021 10:04:30 +0800 Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9A=20logsTab=20=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E7=AA=97=E5=8F=A3=E5=8F=98=E5=8C=96=E7=9A=84resize=E4=BA=8B?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/page/dashboard/explore/logTab.vue | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/nezha-fronted/src/components/page/dashboard/explore/logTab.vue b/nezha-fronted/src/components/page/dashboard/explore/logTab.vue index 4b75af3cc..faa5bb9f6 100644 --- a/nezha-fronted/src/components/page/dashboard/explore/logTab.vue +++ b/nezha-fronted/src/components/page/dashboard/explore/logTab.vue @@ -202,6 +202,7 @@ export default { return } this.myChart = echarts.init(dom) + window.addEventListener('resize', this.resizeChart) if (this.tableChartData.length > 0) { let series = this.tableChartData.map(d => ({ type: 'bar', @@ -431,7 +432,9 @@ export default { return this.limit }, resizeChart () { - this.myChart.resize() + setTimeout(()=>{ + this.myChart.resize() + }) }, aliasLegend (row) { let host = ''// up, @@ -481,7 +484,6 @@ export default { }, tooltipFormatter (params, a, b) { const vm = this - console.log(params, a, b) let str = `
@@ -530,6 +532,9 @@ export default { this.$emit('limitChange', n) } }, + destroyed () { + window.removeEventListener('resize', this.resizeChart) + }, beforeUpdate () { this.$nextTick(() => { if (this.$refs.logTable) {