Open Lucascuibu opened 10 months ago
@Lucascuibu Hi, thanks for issuing, as the error message said: "e3 is not an Object", as for Vuejs rendering process, your variable "node" would still be "undefined" when the setup function runs, try to adjust something like following may solve the issue, thank you. (and it would be even better to use "ref" when accessing dom object in Vuejs)
function generatePDF() {
const node = document.getElementById('content-to-print');
html2PDF(node!, {
jsPDF: {
format: 'a4',
},
imageType: 'image/jpeg',
output: './pdf/generate.pdf'
});
};
I am writing a Vue component:
And received following error: