使用的工具是:html2canvas

html2canvas(this.currentRef)
          .then(async (canvas) => {
            let url = canvas.toDataURL('image/png')
            this.largeScreenForm.screenshotImage = url
            })
this.currentRef是要操作的div

备注:如果要生成图片的div有背景图,那么背景图必须是base64,不然转canvas失败

相关文章:

  • 2021-12-25
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-02
  • 2021-10-25
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-12
  • 2022-12-23
  • 2021-12-06
  • 2022-02-17
相关资源
相似解决方案