首页 前端知识 Can‘t get DOM width or height. Please check dom.clientWidth and dom.clientHeight. They should not be

Can‘t get DOM width or height. Please check dom.clientWidth and dom.clientHeight. They should not be

2025-03-08 14:03:48 前端知识 前端哥 40 561 我要收藏

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,
},
)
复制
转载请注明出处或者链接地址:https://www.qianduange.cn//article/22928.html
标签
评论
发布的文章

Lua与Unity交互

2025-03-08 14:03:36

Pygame介绍与游戏开发

2025-03-08 14:03:36

大家推荐的文章
会员中心 联系我 留言建议 回顶部
复制成功!