From 1758bf490416e12835447c7caea95999a15acf8b Mon Sep 17 00:00:00 2001 From: junjie Date: Sat, 19 Jun 2021 11:11:58 +0800 Subject: [PATCH] =?UTF-8?q?feat(fix):=E8=A7=86=E5=9B=BE=E8=A1=A8=E6=A0=BC?= =?UTF-8?q?=E5=BA=95=E9=83=A8=E9=81=AE=E6=8C=A1=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../chart/components/table/TableNormal.vue | 33 ++++++++++--------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/frontend/src/views/chart/components/table/TableNormal.vue b/frontend/src/views/chart/components/table/TableNormal.vue index b9d5c865e0..3c3b6cc3a8 100644 --- a/frontend/src/views/chart/components/table/TableNormal.vue +++ b/frontend/src/views/chart/components/table/TableNormal.vue @@ -117,23 +117,24 @@ export default { } }, calcHeight() { - const that = this - this.$nextTick(function() { - if (that.$refs.tableContainer) { - const currentHeight = that.$refs.tableContainer.offsetHeight - const tableMaxHeight = currentHeight - that.$refs.title.offsetHeight - let tableHeight - if (that.chart.data) { - tableHeight = (that.chart.data.tableRow.length + 2) * 36 - } else { - tableHeight = 0 + this.$nextTick(() => { + setTimeout(() => { + if (this.$refs.tableContainer) { + const currentHeight = this.$refs.tableContainer.offsetHeight + const tableMaxHeight = currentHeight - this.$refs.title.offsetHeight + let tableHeight + if (this.chart.data) { + tableHeight = (this.chart.data.tableRow.length + 2) * 36 + } else { + tableHeight = 0 + } + if (tableHeight > tableMaxHeight) { + this.height = tableMaxHeight + 'px' + } else { + this.height = 'auto' + } } - if (tableHeight > tableMaxHeight) { - that.height = tableMaxHeight + 'px' - } else { - that.height = 'auto' - } - } + }, 100) }) }, initStyle() {