echart 不显示不报错

检查方法:

1、id是否重复

2、没有设置高度

<div id="chart_id" style="width:100%;height:376px"></div>

3、确保dom元素已经挂载到页面中,初始化echart写在mounted中

mounted(){
  this.initEchart()  
},

或者使用$nextTick

this.$nextTick(() => {
     this.initEchart(); 
});

 

posted @ 2021-05-13 10:28  科技改变未来☆  阅读(189)  评论(0编辑  收藏  举报