[Vue warn]: You may have an infinite update loop in watcher with express

echarts中option的data传数组,千万不要对数组进行操作.
否则会出bug
you may have an infinite update loop in watcher with expression

错误分析:
首先chartSource在created生命周期中获取数据时也发生了变化,watch监听到后,重新渲染图标执行option操作,结果option中的data中的数组进行倒置了,

 data: data.xAxis.reverse()

那么watch监听的chartSource又发生变化,陷入了无限死循环中。

父组件中的传参:

[Vue warn]: You may have an infinite update loop in watcher with express_第1张图片

子组件:

[Vue warn]: You may have an infinite update loop in watcher with express_第2张图片

[Vue warn]: You may have an infinite update loop in watcher with express_第3张图片

你可能感兴趣的:(echarts,vue项目开发,vue.js)