完善预览功能

This commit is contained in:
2026-07-19 23:50:02 +08:00
parent 3c6b142098
commit f725261370
6 changed files with 132 additions and 13 deletions

View File

@@ -78,6 +78,7 @@ const props = withDefaults(
defaultDocumentMode?: DocumentMode;
appTheme?: AppTheme;
renderSingleLineBreaks?: boolean;
paragraphIndent?: boolean;
}>(),
{
initialPage: "about",
@@ -85,6 +86,7 @@ const props = withDefaults(
defaultDocumentMode: "edit",
appTheme: "warm",
renderSingleLineBreaks: false,
paragraphIndent: false,
},
);
@@ -93,6 +95,7 @@ const emit = defineEmits<{
updateDefaultDocumentMode: [mode: DocumentMode];
updateAppTheme: [theme: AppTheme];
updateRenderSingleLineBreaks: [value: boolean];
updateParagraphIndent: [value: boolean];
prepareWorkspaceSync: [done: (saved: boolean) => void];
workspaceSynced: [];
}>();
@@ -604,6 +607,20 @@ onBeforeUnmount(() => {
<span></span>
</label>
</div>
<div class="settings-row">
<div class="settings-copy">
<h3>段落首行缩进</h3>
<p>开启后预览和混合模式下段落首行会缩进两个字符更符合中文排版习惯</p>
</div>
<label class="settings-switch" title="段落首行缩进">
<input
:checked="paragraphIndent"
type="checkbox"
@change="emit('updateParagraphIndent', ($event.target as HTMLInputElement).checked)"
/>
<span></span>
</label>
</div>
</section>
</div>