fix: 修复长文档分页与滚动同步

This commit is contained in:
SkyJourney
2026-07-26 08:43:56 +08:00
parent 1d93f31f85
commit d62552384f
15 changed files with 449 additions and 61 deletions
+23 -1
View File
@@ -2,6 +2,7 @@ import {
getPaperDimensionsMm,
type ExportConfig
} from "@md-to-pdf/core";
import { PREVIEW_SCROLLBAR_WIDTH_PX } from "./preview-page";
export const PAGED_PREVIEW_MESSAGE_SCOPE = "md-to-pdf:paged-preview";
@@ -335,7 +336,27 @@ ${
width: max-content;
min-width: 100%;
margin: 0 auto;
padding: 0;
padding: 34px 0;
}
html[data-render-target="preview"] {
height: 100%;
overflow-x: hidden;
overflow-y: scroll;
scrollbar-gutter: stable;
}
html[data-render-target="preview"]::-webkit-scrollbar {
width: ${PREVIEW_SCROLLBAR_WIDTH_PX}px;
}
html[data-render-target="preview"]::-webkit-scrollbar:horizontal {
height: 0;
}
html[data-render-target="preview"] body {
min-height: 100%;
overflow: visible;
}
.pagedjs_page {
@@ -354,6 +375,7 @@ html[data-render-target="pdf"] .pagedjs_pages {
display: block;
width: auto;
min-width: 0;
padding: 0;
}
html[data-render-target="pdf"] .pagedjs_page {