<template>
  <div>
    <div ref="wordcloud" class="wordcloud">
    </div>
    <button @click="download">下载</button>
  </div>
</template>
download(){
  let mycanvas=document.getElementsByTagName('canvas')[0]
  let image=mycanvas.toDataURL("image/png");
  let $a = document.createElement('a');
  $a.setAttribute("href", image);
  $a.setAttribute("download", "echarts图片下载.png");
  $a.click();
}
Logo

前往低代码交流专区

更多推荐