代码提交-3-13
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
|
||||
<script setup>
|
||||
import * as echarts from "echarts";
|
||||
import { nextTick, onMounted, ref } from "vue";
|
||||
import { nextTick, onMounted, onUnmounted, ref, watch } from "vue";
|
||||
import { listCircularDiagram } from "@/api/sidebar/reportAnalytics.js";
|
||||
import { defineProps } from "vue";
|
||||
|
||||
@@ -51,10 +51,12 @@ var option = {
|
||||
};
|
||||
|
||||
//监听到有新值传入,调用函数重新渲染
|
||||
watch(props, newData => {
|
||||
option.series.data = newData.data;
|
||||
freshEchart();
|
||||
});
|
||||
watch(() => props.data, (newData) => {
|
||||
if (chartInstance && newData) {
|
||||
option.series[0].data = newData;
|
||||
freshEchart();
|
||||
}
|
||||
}, { deep: true });
|
||||
|
||||
onMounted(async () => {
|
||||
await nextTick(); //确保dow已经渲染完成
|
||||
|
||||
Reference in New Issue
Block a user