From 4bba623770ef6d93260eb999457810d8880b50a9 Mon Sep 17 00:00:00 2001 From: dataeaseShu <106045316+dataeaseShu@users.noreply.github.com> Date: Mon, 31 Jul 2023 15:07:45 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=A7=86=E5=9B=BE=E6=A0=B7=E5=BC=8F-?= =?UTF-8?q?=E6=8F=90=E7=A4=BA=E5=AF=BC=E8=87=B4=E4=BB=AA=E8=A1=A8=E6=9D=BF?= =?UTF-8?q?=E5=8F=91=E7=94=9F=E6=8A=96=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/views/chart/components/ChartComponent.vue | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/frontend/src/views/chart/components/ChartComponent.vue b/frontend/src/views/chart/components/ChartComponent.vue index 627aa1c803..0d30eaee87 100644 --- a/frontend/src/views/chart/components/ChartComponent.vue +++ b/frontend/src/views/chart/components/ChartComponent.vue @@ -184,13 +184,13 @@ export default { }, mounted() { bus.$on('change-series-id', this.changeSeriesId) - document.querySelector('body').addEventListener('mouseover', this.bodyMouseover) - document.querySelector('body').addEventListener('mouseout', this.bodyMouseout) + document.getElementById(this.chartId).addEventListener('mouseover', this.bodyMouseover) + document.getElementById(this.chartId).addEventListener('mouseout', this.bodyMouseout) this.preDraw() }, beforeDestroy() { - document.querySelector('body').removeEventListener('mouseover', this.bodyMouseover) - document.querySelector('body').removeEventListener('mouseout', this.bodyMouseout) + document.getElementById(this.chartId).removeEventListener('mouseover', this.bodyMouseover) + document.getElementById(this.chartId).removeEventListener('mouseout', this.bodyMouseout) bus.$off('change-series-id', this.changeSeriesId) window.removeEventListener('resize', this.myChart.resize) this.myChart.dispose()