const onPrint = () => {
let printNode:any = document.getElementById('previewEditorContentTextBox');
let iframe:any = document.createElement('iframe');
iframe.setAttribute('style', 'position:absolute;width:0px;height:0px;left:-500px;top:-500px;');
document.body.appendChild(iframe);
iframe.contentDocument.write(printNode.innerHTML);
iframe.contentDocument.close();
iframe.contentWindow.print();
document.body.removeChild(iframe);
}
网友评论