From 8759438ca3812168f1157d3434931624d14531fd Mon Sep 17 00:00:00 2001 From: fuliqi <fuliqi@qq.com> Date: 星期五, 27 九月 2024 17:07:29 +0800 Subject: [PATCH] 图表初始化bug --- src/views/home/data-face/index.vue | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/views/home/data-face/index.vue b/src/views/home/data-face/index.vue index ae50412..a81bb08 100644 --- a/src/views/home/data-face/index.vue +++ b/src/views/home/data-face/index.vue @@ -28,8 +28,8 @@ import * as echarts from 'echarts'; import {car, face} from "../../../api/platform/home"; -var chartDom = document.getElementById('main'); -var myChart = echarts.init(chartDom); + +var myChart = null; var option; let observer = null; export default { @@ -276,6 +276,7 @@ const month = (date.getMonth() + 1) >= 10 ? date.getMonth() + 1 : '0' + (date.getMonth() + 1); this.date = year + '-' + month; this.params.date = this.date; + myChart = echarts.init(this.$refs.chartContent); this.getChart(); this.observe(); }, -- Gitblit v1.8.0