let doc = document.getElementById("shareInfo");
html2canvas(doc, {
useCORS: true,
height: doc.clientHeight - 2, // 根据具体情况进行调整
width: doc.clientWidth - 2,
}).then((canvas) => {
const newSrc = canvas.toDataURL("image/png");
console.log(newSrc);
tempImg.value = newSrc;
});
具体介绍可以看官网:html2canvas - Screenshots with JavaScript
https://html2canvas.hertzen.com/
5259

被折叠的 条评论
为什么被折叠?



