刘光辉
7 小时以前 0dfe84494048ce27ba8449831782128412d3eb13
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
<script lang="ts" setup>
import type { EChartsOption } from 'echarts';
 
import type { EchartsUIType } from '@vben/plugins/echarts';
 
import { ref, watch } from 'vue';
 
import { EchartsUI, useEcharts } from '@vben/plugins/echarts';
 
defineOptions({ name: 'StabilityTrendChart' });
 
const props = defineProps<{ option: EChartsOption }>();
const chartRef = ref<EchartsUIType>();
const { renderEcharts } = useEcharts(chartRef);
 
watch(
  () => props.option,
  (option) => renderEcharts(option),
  { deep: true, immediate: true },
);
</script>
 
<template>
  <EchartsUI ref="chartRef" height="520px" width="100%" />
</template>