Vue2.js:Echarts点击事件的绑定与解绑

文档

代码示例

export default {
    
    
    mounted() {
    
    
        this.echart = Echarts.init(document.getElementById(this.echartId))

        // 绑定点击事件
        this.echart.on('click', this.handleEChartsClick)

        // 销毁
        this.$once('hook:beforeDestroy', () => {
    
    
          this.echart.off('click', this.handleEChartsClick)
        })
    }
}

猜你喜欢

转载自blog.csdn.net/mouday/article/details/127226700
今日推荐