import React, { PureComponent } from "react";
import ReactEcharts from 'echarts-for-react';
import { useEventListener } from 'ahooks';
useEventListener(
'resize',
() => {
ref?.current?.getEchartsInstance()?.reresize;
},
);
return (
<ReactEcharts
ref={ref}
option={pieOption(distributionData?.parentModelInfoList || [], {})}
style={{
height: '320px',
width: clientWidth,
}}
/>
);
标签:图表,useEventListener,react,import,echarts,resize From: https://www.cnblogs.com/webqiand/p/18094831