<div class="zEcharts" style="width: 500px; height: 70vh">
<div
class="map-container"
id="myEcharts"
ref="myEchart"
style="height: 100%; width: 100%"
></div>
</div>
import china from "@/datamaster/china.json";
export default {
name: "zEcharts",
data() {
return {
myEchart: "",
optionChinaMap: {}, //地图数据,等待接口数据
};
},
props: {
typeFlag: {
type: Boolean,
default: true,
},
},
mounted() {
this.$nextTick(() => {
this.initEcharts();
});
},
methods: {
/**
* 地图数据
*/
randomData: function () {
return Math.round(Math.random() * 1000);
},
/**
* echarts实例话
*/
initEcharts: function () {
//这行代码是重点