Error screenshot
question
Although `height` class
is set in width
the console, the warning is issued
After checking the Internet, I found that many netizens had similar problems, and a similar problem github
was mentioned in: https://github.com/apache/echarts/issues/4569issue
github isssue
Solution
The and of cannot be dom
obtained . The new version supports specifying height and width during initialization. http://echarts.baidu.com/api.html#echarts.initclientWidth
clientHeight
// 当echarts被封装成一个组件时,height和width作为props传入
const myChart = this.$echarts.init(
ele,
theme,
{
height: this.height,
width: this.width,
},
)