fix: print paging

This commit is contained in:
2026-02-27 17:44:02 +08:00
parent dad93d06e3
commit e22a8da12a
4 changed files with 13 additions and 10 deletions
+1 -1
View File
@@ -36,7 +36,7 @@ export function CardPreview(props: CardPreviewProps) {
let cardRef: HTMLDivElement | undefined;
return (
<div class="flex justify-center">
<div class="flex justify-center overflow-hidden">
<Show when={store.state.activeTab < store.state.cards.length}>
<div
ref={cardRef}
+4 -4
View File
@@ -159,8 +159,8 @@ export function PrintPreview(props: PrintPreviewProps) {
const visibleLayers = createMemo(() => store.state.layerConfigs.filter((l) => l.visible));
return (
<div class="fixed inset-0 bg-black/50 z-50 overflow-auto">
<div class="min-h-screen py-20 px-4">
<div class="fixed inset-0 bg-black/50 z-50 overflow-auto print:overflow-visible print:absolute">
<div class="min-h-screen py-20 px-4 print:p-0">
{/* 打印预览控制栏 */}
<div class="fixed top-0 left-0 right-0 z-50 bg-white shadow-lg rounded-lg mx-4 mt-4 px-4 py-1 flex items-center justify-between gap-4">
<div class="flex items-center gap-4">
@@ -185,11 +185,11 @@ export function PrintPreview(props: PrintPreviewProps) {
</div>
{/* A4 纸张预览 */}
<div class="flex flex-col items-center gap-8">
<div class="flex flex-col items-center gap-8 print-root">
<For each={pages()}>
{(page) => (
<div
class="bg-white shadow-xl print:shadow-none print:w-full in-print"
class="bg-white shadow-xl print:shadow-none print:w-full"
style={{
width: `${A4_WIDTH}mm`,
height: `${A4_HEIGHT}mm`