diff --git a/.changeset/five-teachers-beg.md b/.changeset/five-teachers-beg.md new file mode 100644 index 0000000000..9636fcd670 --- /dev/null +++ b/.changeset/five-teachers-beg.md @@ -0,0 +1,5 @@ +--- +'@td-design/lego': patch +--- + +修复3d饼图卡顿问题 diff --git a/packages/lego/src/three-dimensional-pie/index.tsx b/packages/lego/src/three-dimensional-pie/index.tsx index 2b8aa6a26a..3a0bdcfa9d 100644 --- a/packages/lego/src/three-dimensional-pie/index.tsx +++ b/packages/lego/src/three-dimensional-pie/index.tsx @@ -184,6 +184,7 @@ export default forwardRef( // 监听鼠标事件 useEffect(() => { let hoveredIndex = ''; + if (autoLoop) return; if (echartsRef && seriesData) { const myChart = getInstance(); myChart.on('mouseover', function (params: { seriesName?: string }) { @@ -196,7 +197,7 @@ export default forwardRef( } }); // 如果触发 mouseover 的扇形当前已高亮,则不做操作 - if (autoLoop || hoveredIndex === seriesIndex) { + if (hoveredIndex === seriesIndex) { return; } else { if (hoveredIndex !== '') { @@ -212,7 +213,6 @@ export default forwardRef( }); } hoveredIndex = hoveredIndex !== '' ? '' : seriesIndex; - setHoveredIndex(hoveredIndex); myChart.setOption(option); } });