1200字范文,内容丰富有趣,写作的好帮手!
1200字范文 > 使用Echart报错Cannot read property ‘getAttribute‘ of undefined

使用Echart报错Cannot read property ‘getAttribute‘ of undefined

时间:2020-08-29 11:31:48

相关推荐

使用Echart报错Cannot read property ‘getAttribute‘ of undefined

项目中使用Echart报错,百度结果说生命周期性错误,解决办法是

mounted() {this.$nextTick(() => {this.drawLine();});}

此方法可以解决百分之90的错误,还有百分之十是因为

在mounted里写nexttick 结果发现 打印结果还是 没有找到继续报错,

最后 发现, 写Echart的盒子 不能放到 for 循环里面 不然 这个盒子 ref是找不到他的,需要放到for 循环外面。

最后 打印结果 盒子成功找到。

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。