You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by GitBox <gi...@apache.org> on 2021/10/21 16:12:38 UTC

[GitHub] [echarts] Kinghts commented on issue #5093: echarts.js:3066 Uncaught Error: `setOption` should not be called during main process

Kinghts commented on issue #5093:
URL: https://github.com/apache/echarts/issues/5093#issuecomment-948766578


   跟vue一起用时出现了这个问题,解决了,就是不要让echart实例变成vue的响应式对象:
   ```
   data() {
     return {
       id: 'chart-xxxxx',
       instance: null,
     };
   },
   mounted() {
     this.instance = Object.freeze({ chart: echart.init(document.getElementById(this.id)) });
   },
   ```
   tips: 超大对象放入vue 的data前最好freeze下,不然可能出现把整个页面卡住的性能问题,当然,你得明白自己在干啥,enjoy
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org