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.
github isssue上有类似的问题:https://github.com/apache/echarts/issues/4569
解决办法:
初始化的时候无法获取 dom 的 clientWidth 和 clientHeight,新版本支持初始化的时候指定高宽,http://echarts.baidu.com/api.html#echarts.init
this.$echarts.init( ele, theme, { height: this.height, width: this.width, }, )
复制