Vanessa 2025-04-22 11:28:21 +08:00
parent 21b86f5592
commit 36c923e650

View File

@ -946,7 +946,7 @@ export class Toolbar {
} }
} }
public showRender(protyle: IProtyle, renderElement: HTMLElement, updateElements?: Element[], oldHTML?: string) { public showRender(protyle: IProtyle, renderElement: Element, updateElements?: Element[], oldHTML?: string) {
const nodeElement = hasClosestBlock(renderElement); const nodeElement = hasClosestBlock(renderElement);
if (!nodeElement) { if (!nodeElement) {
return; return;
@ -1116,9 +1116,9 @@ export class Toolbar {
} }
setTimeout(() => { setTimeout(() => {
addScript("/stage/protyle/js/html-to-image.min.js?v=1.11.13", "protyleHtml2image").then(() => { addScript("/stage/protyle/js/html-to-image.min.js?v=1.11.13", "protyleHtml2image").then(() => {
renderElement.style.display = "inline-block"; (renderElement as HTMLHtmlElement).style.display = "inline-block";
window.htmlToImage.toBlob(renderElement).then(blob => { window.htmlToImage.toBlob(renderElement).then(blob => {
renderElement.style.display = ""; (renderElement as HTMLHtmlElement).style.display = "";
const formData = new FormData(); const formData = new FormData();
formData.append("file", blob); formData.append("file", blob);
formData.append("type", "image/png"); formData.append("type", "image/png");