From 2013fa97670a7f9cd97ee85f6fd0304031e5c1a1 Mon Sep 17 00:00:00 2001 From: Qiuxia Fan Date: Thu, 7 Jul 2022 11:17:40 +0800 Subject: [PATCH] hide tips --- src/components/Graph.vue | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/components/Graph.vue b/src/components/Graph.vue index 9ce9cf20..1fce3694 100644 --- a/src/components/Graph.vue +++ b/src/components/Graph.vue @@ -62,7 +62,6 @@ const available = computed( onMounted(async () => { await setOptions(props.option); chartRef.value && addResizeListener(unref(chartRef), resize); - console.log(props.filters); setTimeout(() => { const instance = getInstance(); @@ -72,6 +71,15 @@ onMounted(async () => { instance.on("click", (params: unknown) => { emits("select", params); }); + document.addEventListener( + "click", + () => { + instance.dispatchAction({ + type: "hideTip", + }); + }, + true + ); }, 1000); }); @@ -90,7 +98,6 @@ watch( watch( () => props.filters, () => { - console.log(props.filters); const instance = getInstance(); if (!instance) { return; @@ -101,10 +108,6 @@ watch( dataIndex: props.filters.dataIndex, seriesIndex: 0, }); - } else { - instance.dispatchAction({ - type: "hideTip", - }); } } );