mirror of
https://github.com/pipipi-pikachu/PPTist.git
synced 2025-04-15 02:20:00 +08:00
fix: 尝试修复部分环境导出pdf无法唤起打印窗口(#126 #129)
This commit is contained in:
parent
e6773a4d81
commit
158118a370
@ -74,8 +74,13 @@ export const print = (printNode: HTMLElement, size: PageSize) => {
|
||||
const handleLoadIframe = () => {
|
||||
iframeContentWindow.focus()
|
||||
iframeContentWindow.print()
|
||||
}
|
||||
|
||||
const handleAfterprint = () => {
|
||||
iframeContentWindow.removeEventListener('afterprint', handleAfterprint)
|
||||
document.body.removeChild(iframe)
|
||||
}
|
||||
|
||||
iframe.addEventListener('load', handleLoadIframe)
|
||||
iframeContentWindow.addEventListener('afterprint', handleAfterprint)
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user