ecomfe / vue-echarts

Vue.js component for Apache ECharts™.
https://vue-echarts.dev
MIT License
9.43k stars 1.48k forks source link

控制台警告 #752

Closed lt1067066026 closed 6 months ago

lt1067066026 commented 6 months ago

请确认

您是如何将 Vue-ECharts 引入项目的?

通过 ES 模块 import

版本信息

├── echarts@5.4.3 
├── vue@3.3.10 
└── vue-echarts@6.6.2

问题详情

[ECharts] Can't get DOM width or height. Please check dom.clientWidth and dom.clientHeight. They should not be 0.For example, you may need to call this in the callback of window.onload.

问题复现

https://stackblitz.com/edit/vue-echarts-vue-3?file=src%2FApp.vue

Shyam-Chen commented 6 months ago

Downgrade to v6.6.1.

funny-cat-happy commented 6 months ago

it seems to be a upstream error https://github.com/apache/echarts/issues/10478. And it hasn't been fixed yet. You can add init-options to it.

<v-chart class="chart" :option="heartOption" :init-options="initOption" />
const initOption = {
  width: 'auto',
  height: 300
}
Justineo commented 6 months ago

It is a regression introduced by v6.6.2 and now fixed in v6.6.3.