fix graph

This commit is contained in:
Qiuxia Fan 2022-04-02 11:33:35 +08:00
parent 5fadcaa210
commit 363745aa00

View File

@ -28,6 +28,7 @@ import {
computed,
} from "vue";
import type { PropType } from "vue";
import _ from "lodash";
import { useECharts } from "@/hooks/useEcharts";
import { addResizeListener, removeResizeListener } from "@/utils/event";
@ -71,15 +72,15 @@ onMounted(async () => {
});
watch(
() => props.option,
(newVal, oldVal) => {
() => _.cloneDeepWith(props.option),
(data, old) => {
if (!available.value) {
return;
}
if (JSON.stringify(newVal) === JSON.stringify(oldVal)) {
if (data === old) {
return;
}
setOptions(newVal);
setOptions(data);
}
);