监测点代码优化

This commit is contained in:
仲么了
2024-02-29 10:50:14 +08:00
parent 8175de04bb
commit d9a5a7c9d7
5 changed files with 9 additions and 5 deletions

View File

@@ -16,7 +16,8 @@ const props = defineProps(['options'])
let chart: echarts.ECharts | any = null
const resizeHandler = () => {
// 不在视野中的时候不进行resize
if(chartRef.value!.offsetHeight == 0) return
if (!chartRef.value) return
if (chartRef.value.offsetHeight == 0) return
chart.getZr().painter.getViewportRoot().style.display = 'none'
requestAnimationFrame(() => {
chart.resize()