Skip to content

Commit af2114e

Browse files
committed
feat: 将docx导出的段落统一改为左对齐
1 parent 2527b42 commit af2114e

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/io/export/adapters/docxAdapter.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Document, Packer, Paragraph, Tab, TextRun } from 'docx';
1+
import { AlignmentType, Document, Packer, Paragraph, Tab, TextRun } from 'docx';
22
import type { ExportFormat, ExportStyle, ExportRow } from '@/types/export';
33
import {
44
renderExportDocument,
@@ -23,7 +23,7 @@ function applyStyle(style?: ExportStyle): Record<string, unknown> {
2323
}
2424

2525
function createEmptyParagraph() {
26-
return new Paragraph({});
26+
return new Paragraph({ alignment: AlignmentType.LEFT });
2727
}
2828

2929
function createParagraphFromSegments(
@@ -73,7 +73,7 @@ function createParagraphFromSegments(
7373
}
7474

7575
return runs.length > 0
76-
? new Paragraph({ children: runs })
76+
? new Paragraph({ children: runs, alignment: AlignmentType.LEFT })
7777
: createEmptyParagraph();
7878
}
7979

0 commit comments

Comments
 (0)