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

View File

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