Use $emit in echarts click event to get pit

Use $emit in echarts click event

	//执行点击事件
	let that = this;  //解决this指向问题 TypeError: this.$emit is not a function
    myChart.on('dblclick', function (params) {
    
    
		console.log(params)
	  that.$emit("titleChanged","1")
}		
);

	},

If you write that.$emit("titleChanged","1") directly, an error will be reported! Giant pit

Guess you like

Origin blog.csdn.net/DoChengAoHan/article/details/109156766