|
|
|
@ -24,6 +24,7 @@ import { GridComponent, TooltipComponent, LegendComponent } from "echarts/compon
|
|
|
|
import { CanvasRenderer } from "echarts/renderers";
|
|
|
|
import { CanvasRenderer } from "echarts/renderers";
|
|
|
|
|
|
|
|
|
|
|
|
import { useResizeObserver } from "@vueuse/core";
|
|
|
|
import { useResizeObserver } from "@vueuse/core";
|
|
|
|
|
|
|
|
import { nextTick, onBeforeUnmount, onMounted, ref, watch } from "vue";
|
|
|
|
|
|
|
|
|
|
|
|
defineOptions({ name: "FaECharts" });
|
|
|
|
defineOptions({ name: "FaECharts" });
|
|
|
|
|
|
|
|
|
|
|
|
@ -71,7 +72,7 @@ useResizeObserver(chartRef, () => {
|
|
|
|
// 监听 options 变化,更新图表
|
|
|
|
// 监听 options 变化,更新图表
|
|
|
|
watch(
|
|
|
|
watch(
|
|
|
|
() => props.options,
|
|
|
|
() => props.options,
|
|
|
|
(newOptions) => {
|
|
|
|
(newOptions: echarts.EChartsCoreOption) => {
|
|
|
|
if (chartInstance && newOptions) {
|
|
|
|
if (chartInstance && newOptions) {
|
|
|
|
chartInstance.setOption(newOptions);
|
|
|
|
chartInstance.setOption(newOptions);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|