The screenshot of vue project using html2canvas, is confused.

uses the latest "html2canvas": "^ 1.0.0-alpha.12"

configure

print(){
   let printMeEl = this.$refs.printMe
   this.$html2canvas(printMeEl, {
        type: "dataURL",
        useCORS: true,
   }).then((canvas) => {
        this.output = canvas
   })
}

Click a button on the page to trigger the print () method, but the resulting screenshot is very messy. All the structures are listed from top to bottom, and no styles are loaded. Excuse me, what"s going on?

Dec.08,2021

html2canvas screenshots have bug when your page elements are generated by js, or elements like svg appear.
cannot be rendered.

Menu