<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();
}

  

相关文章:

  • 2021-09-24
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-08
  • 2021-12-11
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-12-04
  • 2023-01-31
  • 2022-12-23
  • 2022-12-23
  • 2021-04-25
  • 2022-12-23
相关资源
相似解决方案