惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

C
CXSECURITY Database RSS Feed - CXSecurity.com
K
Kaspersky official blog
A
Arctic Wolf
Attack and Defense Labs
Attack and Defense Labs
L
LINUX DO - 热门话题
N
News | PayPal Newsroom
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
L
Lohrmann on Cybersecurity
PCI Perspectives
PCI Perspectives
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
The Last Watchdog
The Last Watchdog
B
Blog RSS Feed
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
W
WeLiveSecurity
Know Your Adversary
Know Your Adversary
博客园 - Franky
T
Tenable Blog
T
Tailwind CSS Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Help Net Security
Help Net Security
WordPress大学
WordPress大学
T
The Exploit Database - CXSecurity.com
www.infosecurity-magazine.com
www.infosecurity-magazine.com
博客园 - 司徒正美
阮一峰的网络日志
阮一峰的网络日志
D
Darknet – Hacking Tools, Hacker News & Cyber Security
H
Heimdal Security Blog
TaoSecurity Blog
TaoSecurity Blog
S
Security Affairs
J
Java Code Geeks
小众软件
小众软件
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Apple Machine Learning Research
Apple Machine Learning Research
NISL@THU
NISL@THU
O
OpenAI News
The Cloudflare Blog
月光博客
月光博客
Google Online Security Blog
Google Online Security Blog
V
V2EX
罗磊的独立博客
美团技术团队
博客园 - 三生石上(FineUI控件)
Security Latest
Security Latest
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
C
Cyber Attacks, Cyber Crime and Cyber Security
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Cyberwarzone
Cyberwarzone
L
LINUX DO - 最新话题
Hacker News - Newest:
Hacker News - Newest: "LLM"
大猫的无限游戏
大猫的无限游戏

博客园 - 一丝心情

Volta 安装和使用指南 免费国产ai试用总结 glb格式3d模型压缩 nuxt.js 项目流水线自动部署设置 免费的云数据库 vue 实用指令 IntelliJ IDEA license server 激活(亲测有效) win10/win11专业版激活码(亲测有效) Git 常用指令完全指南 npm 安装依赖报错整理 css3文字渐变, svg文字渐变 http/https与websocket的ws/wss的关系 指令 v-tooltip vue 自定义指令实现v-overflow-tooltip element-ui NavMenu 多级嵌套封装 常用css vue.config.js config.resolve.alias 目录别名配置 three.js 在低版本浏览报THREE.WebGLProgran: shader error 报错解决办法 nuxt 低版本浏览器兼容babel编译配置 常用软件历史版本下载 前端常用指令 数组常用方法总结 常用正则
vue 中 echarts 添加事件
一丝心情 · 2022-07-14 · via 博客园 - 一丝心情

1. vue项目中echarts 添加事件

<template>
    <div ref="MyChart"></div>
</template>
              const MyChart = this.$refs.MyChart[0]
              if(MyChart) {
                MyChart.chart.on('datazoom', (e)=> {
                  const {start, end} = e.batch ? e.batch[0] : e
                  console.log(`start: ${start}, end: ${end}`)
                })
              }

2. vue-echarts 中添加事件(个别版本组件上的事件不生效,可以使用原生的事件)

<template>

    <v-chart 
    class="chart-box" 
    :options="polar"
     @click="handleClick" 
     @datazoom="handledatazoom"/>
</template>

<script>
export default {

      data() {
        return {
          polar: {
            dataZoom: [
              {
                type: 'inside',
                startValue: 0,
                endValue: 10
              },
              {
                startValue: 0,
                endValue: 10
              }
            ],
            xAxis: {},
            yAxis: {},
            series: []
          }
        }
      },

      created(){},
      mounted(){},
      methods:{
        handleClick(e) {
          const {name, value} = e
          console.log(`name: ${name}, value: ${value}`)
        },
        handledatazoom(e) {
          const {start, end} = e.batch ? e.batch[0] : e
          console.log(`start: ${start}, end: ${end}`)

            this.polar.dataZoom[0].start = start
            this.polar.dataZoom[0].end = end
            this.polar.dataZoom[1].start = start
            this.polar.dataZoom[1].end = end
        }
      }
}

</script>