渲染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() })