1.mounted添加单击事件
mounted() {
window.menuHandle = this.menuHandle
const userInfo = window.localStorage.getItem('userInfo')
if (userInfo) {
// 1. 创建一个 ECharts 实例,返回 echartsInstance,不能在单个容器上初始化多个 ECharts 实例
this.myChart = echarts.init(this.$refs.echart_china);
this.drawmap();
this.clickGoNext();
}
},
2.添加单击方法
clickGoNext() {
// 鼠标事件
this.myChart.on("click", function (res) {
console.log("click city:", res.name);
});
}
本文暂时没有评论,来添加一个吧(●'◡'●)