From 5670956e5e4f3e88ad5d45cd0fb52c0660534839 Mon Sep 17 00:00:00 2001 From: chenshuai2144 Date: Thu, 19 Dec 2024 01:10:15 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=BAMarkdown=E7=BC=96=E8=BE=91=E5=99=A8?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0editorStyle=E5=B1=9E=E6=80=A7=EF=BC=8C?= =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=A0=B7=E5=BC=8F=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/MarkdownEditor/editor/Editor.tsx | 2 ++ src/MarkdownEditor/index.tsx | 3 +++ src/Slides/index.tsx | 4 ++++ 3 files changed, 9 insertions(+) diff --git a/src/MarkdownEditor/editor/Editor.tsx b/src/MarkdownEditor/editor/Editor.tsx index 3ac52ed..3b92c3b 100644 --- a/src/MarkdownEditor/editor/Editor.tsx +++ b/src/MarkdownEditor/editor/Editor.tsx @@ -616,9 +616,11 @@ export const MEditor = observer( reportMode ? { fontSize: 16, + ...editorProps.style, } : { fontSize: 14, + ...editorProps.style, } } onMouseDown={checkEnd} diff --git a/src/MarkdownEditor/index.tsx b/src/MarkdownEditor/index.tsx index e6a3406..4184b76 100644 --- a/src/MarkdownEditor/index.tsx +++ b/src/MarkdownEditor/index.tsx @@ -147,6 +147,7 @@ export type MarkdownEditorProps = { */ style?: React.CSSProperties; contentStyle?: React.CSSProperties; + editorStyle?: React.CSSProperties; /** * 是否显示目录 */ @@ -258,6 +259,7 @@ export const MarkdownEditor: React.FC = (props) => { readonly, style, contentStyle, + editorStyle, height, ...rest } = props; @@ -418,6 +420,7 @@ export const MarkdownEditor: React.FC = (props) => { prefixCls={baseClassName} note={instance.current!} {...rest} + style={editorStyle} instance={instance} /> {readonly ? ( diff --git a/src/Slides/index.tsx b/src/Slides/index.tsx index c8cf5cf..722ac62 100644 --- a/src/Slides/index.tsx +++ b/src/Slides/index.tsx @@ -57,6 +57,10 @@ export function Slides(props: { initValue: string }) { margin: 0, width: '100%', }} + editorStyle={{ + maxHeight: '80vh', + overflow: 'auto', + }} contentStyle={{ width: '100%', padding: 0,