From f494b8a3b9ff4f9e61eabfbeb52126ff11c69abc Mon Sep 17 00:00:00 2001 From: Qiuxia Fan Date: Tue, 19 Jul 2022 11:04:07 +0800 Subject: [PATCH] fix --- src/components/Graph.vue | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/components/Graph.vue b/src/components/Graph.vue index ade73e76..0222dca1 100644 --- a/src/components/Graph.vue +++ b/src/components/Graph.vue @@ -95,7 +95,7 @@ onMounted(async () => { ) { return; } - const series = props.option.series; + const series = (window as any).structuredClone(props.option.series); for (const temp of series) { if (temp.markArea) { delete temp.markArea; @@ -105,6 +105,9 @@ onMounted(async () => { ...props.option, series, }; + if (JSON.stringify(options) === JSON.stringify(props.option)) { + return; + } setOptions(options); }, true @@ -149,7 +152,7 @@ watch( ], ], }; - const series = props.option.series; + const series = (window as any).structuredClone(props.option.series); for (const [key, temp] of series.entries()) { if (key === 0) { temp.markArea = markArea; @@ -159,6 +162,9 @@ watch( ...props.option, series, }; + if (JSON.stringify(options) === JSON.stringify(props.option)) { + return; + } setOptions(options); return; }