渲染echarts时候,需要等DOM完全加载了在开始渲染,不然初始化时会显示不了地图

this.$nextTick(()=>{
      that.chart = this.$echarts.init(document.querySelector('.china'));
      console.log('chart', that.chart)
      // console.log(this.$el); 两者相等
      // console.log(document.querySelector('.china'));
      that.initChart("china", "中国");
      // that.initCountry()
    })

 

相关文章:

  • 2021-12-30
  • 2022-12-23
猜你喜欢
  • 2021-11-01
  • 2021-05-31
  • 2022-12-23
  • 2022-12-23
  • 2021-07-06
  • 2021-06-27
  • 2022-12-23
相关资源
相似解决方案