feat: shape for cards

This commit is contained in:
hyper
2026-03-14 15:48:55 +08:00
parent 984b8aa1c8
commit 107e6fd6a2
7 changed files with 142 additions and 31 deletions
+6
View File
@@ -2,6 +2,7 @@ import { customElement, noShadowDOM } from 'solid-element';
import { Show, onCleanup } from 'solid-js';
import { resolvePath } from '../utils/path';
import { createDeckStore } from './hooks/deckStore';
import type { CardShape } from './types';
import { DeckHeader } from './DeckHeader';
import { DeckContent } from './DeckContent';
import { PrintPreview } from './PrintPreview';
@@ -16,6 +17,7 @@ interface DeckProps {
gridH?: number;
bleed?: number | string;
padding?: number | string;
shape?: CardShape;
layers?: string;
backLayers?: string;
fixed?: boolean | string;
@@ -30,6 +32,7 @@ customElement<DeckProps>('md-deck', {
gridH: 8,
bleed: 1,
padding: 2,
shape: 'rectangle',
layers: '',
backLayers: '',
fixed: false
@@ -87,6 +90,9 @@ customElement<DeckProps>('md-deck', {
store.actions.setPadding(props.padding ?? 2);
}
// 设置形状
store.actions.setShape(props.shape ?? 'rectangle');
// 加载 CSV 数据
store.actions.loadCardsFromPath(
resolvedSrc,