src/components/Echarts/echarts.vue
@@ -116,7 +116,7 @@ initAttempts += 1 if (!isContainerReady()) { // 等容器真正有尺寸(避免首屏初始化偏移/空白,热更新后才正常的情况) // 等容器真正有规格型号(避免首屏初始化偏移/空白,热更新后才正常的情况) // 最多重试约 3 秒,避免无限循环 if (initAttempts < 60) { initTimer = setTimeout(initChartWhenReady, 50) @@ -132,7 +132,7 @@ emit('click', params) }) renderChart() // setOption 后补一次 resize,确保首屏尺寸正确 // setOption 后补一次 resize,确保首屏规格型号正确 nextTick(() => { if (chartInstance) chartInstance.resize() })