Skip to content

Commit eaf76f9

Browse files
committed
fix(admin/components/button): 结束打印之后自动删除 iframe
1 parent 76fc61d commit eaf76f9

2 files changed

Lines changed: 4 additions & 8 deletions

File tree

admin/src/components/button/print.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ export function PrintButton(props: Props) {
3232

3333
return <Button icon {...btnProps} onClick={() => {
3434
const d = new Printd();
35-
d.print(props.container(), props.cssText ? [props.cssText] : undefined);
35+
d.print(props.container(), props.cssText ? [props.cssText] : undefined, undefined, (arg)=>{
36+
arg.launchPrint();
37+
arg.iframe.remove();
38+
});
3639
}}>print</Button>;
3740
}

admin/src/style.css

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,6 @@
3838
}
3939
}
4040

41-
/* 打印的全局设置 */
42-
@media print {
43-
.no-print {
44-
display: none;
45-
}
46-
}
47-
4841
kbd {
4942
@apply border-[1px] border-palette-fg-low rounded-sm bg-palette-bg-low px-1 py-[1px];
5043
}

0 commit comments

Comments
 (0)