refactor: clean up deck wise font size

This commit is contained in:
2026-02-28 12:20:34 +08:00
parent a2ac902129
commit f53dc847ca
8 changed files with 12 additions and 51 deletions
+1 -9
View File
@@ -16,7 +16,6 @@ interface DeckProps {
gridH?: number;
bleed?: number | string;
padding?: number | string;
fontSize?: number;
layers?: string;
fixed?: boolean | string;
}
@@ -30,7 +29,6 @@ customElement<DeckProps>('md-deck', {
gridH: 8,
bleed: 1,
padding: 2,
fontSize: 3,
layers: '',
fixed: false
}, (props, { element }) => {
@@ -80,19 +78,13 @@ customElement<DeckProps>('md-deck', {
} else {
store.actions.setBleed(props.bleed ?? 1);
}
if (typeof props.padding === 'string') {
store.actions.setPadding(Number(props.padding));
} else {
store.actions.setPadding(props.padding ?? 2);
}
if (typeof props.fontSize === 'string') {
store.actions.setFontSize(Number(props.fontSize));
} else {
store.actions.setFontSize(props.fontSize ?? 3);
}
// 加载 CSV 数据
store.actions.loadCardsFromPath(resolvedSrc, csvPath, (props.layers as string) || '');