File tree Expand file tree Collapse file tree 3 files changed +13
-5
lines changed
Expand file tree Collapse file tree 3 files changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -71,7 +71,7 @@ export default () => {
7171 },
7272 };
7373
74- return <EChartsNextForReactCore option = { option } />;
74+ return <EChartsNextForReactCore lazyUpdate = { true } option = { option } />;
7575};
7676```
7777
Original file line number Diff line number Diff line change 11{
22 "name" : " echarts-next-for-react" ,
3- "version" : " 1.0.7 " ,
3+ "version" : " 1.0.8 " ,
44 "description" : " Echarts(v5.x | next) components for react." ,
55 "main" : " dist/index.js" ,
66 "module" : " dist/index.esm.js" ,
Original file line number Diff line number Diff line change @@ -58,7 +58,7 @@ const EChartsNextForReactCore: FC<EChartsNextForReactCoreProps> = (props) => {
5858 const getChartDom = ( ) => {
5959 const chartObj = getChartInstance ( ) ;
6060 if ( chartObj ) {
61- chartObj . setOption ( option , notMerge ?? false , lazyUpdate ?? false ) ;
61+ chartObj . setOption ( option , notMerge ?? false , ! ! lazyUpdate ?? false ) ;
6262 if ( showLoading ) {
6363 chartObj . showLoading ( ) ;
6464 } else {
@@ -124,8 +124,16 @@ const EChartsNextForReactCore: FC<EChartsNextForReactCoreProps> = (props) => {
124124
125125 useEffect ( ( ) => {
126126 const chartDom = getChartDom ( ) ;
127- if ( chartDom ) {
128- chartDom . resize ( ) ;
127+ // @ts -ignore
128+ if ( chartDom ?. _dom ) {
129+ // @ts -ignore
130+ bind ( chartDom . _dom , ( ) => {
131+ try {
132+ chartDom ?. resize ( ) ;
133+ } catch ( e ) {
134+ console . error ( e ) ;
135+ }
136+ } ) ;
129137 }
130138 } , [ style , className , showLoading ] ) ;
131139
You can’t perform that action at this time.
0 commit comments