项目中使用Echart报错,百度结果说生命周期性错误,解决办法是
mounted() {this.$nextTick(() => {this.drawLine();});}
此方法可以解决百分之90的错误,还有百分之十是因为
在mounted里写nexttick 结果发现 打印结果还是 没有找到继续报错,
最后 发现, 写Echart的盒子 不能放到 for 循环里面 不然 这个盒子 ref是找不到他的,需要放到for 循环外面。
最后 打印结果 盒子成功找到。
时间:2020-08-29 11:31:48
项目中使用Echart报错,百度结果说生命周期性错误,解决办法是
mounted() {this.$nextTick(() => {this.drawLine();});}
此方法可以解决百分之90的错误,还有百分之十是因为
在mounted里写nexttick 结果发现 打印结果还是 没有找到继续报错,
最后 发现, 写Echart的盒子 不能放到 for 循环里面 不然 这个盒子 ref是找不到他的,需要放到for 循环外面。
最后 打印结果 盒子成功找到。