fix: md-bg articlePath passing

This commit is contained in:
hypercross 2026-04-09 11:53:24 +08:00
parent 385bcb16d8
commit 2aaca2c56f
2 changed files with 4 additions and 2 deletions

View File

@ -11,6 +11,7 @@ import { CardLayer } from './CardLayer';
import { PltPreview } from './PltPreview';
export interface PrintPreviewProps {
articlePath?: string,
store: DeckStore;
onClose: () => void;
onExport: () => void;
@ -169,7 +170,7 @@ export function PrintPreview(props: PrintPreviewProps) {
clip-path={shapeClipPath ? `url(#${clipPathId})` : undefined}
>
<div class="w-full h-full bg-white" {...({ xmlns: 'http://www.w3.org/1999/xhtml' } as any)}>
<div
<article data-src={props.articlePath}
class="absolute"
style={{
position: 'absolute',
@ -184,7 +185,7 @@ export function PrintPreview(props: PrintPreviewProps) {
cardData={card.data}
side={card.side || 'front'}
/>
</div>
</article>
</div>
</foreignObject>
</g>

View File

@ -111,6 +111,7 @@ customElement<DeckProps>('md-deck', {
{/* 导出 PDF 预览弹窗 */}
<Show when={store.state.isExporting}>
<PrintPreview
articlePath={articlePath}
store={store}
onClose={() => store.actions.setExporting(false)}
onExport={() => {}}