From ac086db1edde68ea068f09f81974b581c76f539f Mon Sep 17 00:00:00 2001 From: landaiqing Date: Wed, 26 Nov 2025 22:11:16 +0800 Subject: [PATCH] :recycle: Updated markdown preview extension --- .../editor/extensions/markdownPreview/PreviewPanel.vue | 6 +++--- .../src/views/editor/extensions/markdownPreview/manager.ts | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/frontend/src/views/editor/extensions/markdownPreview/PreviewPanel.vue b/frontend/src/views/editor/extensions/markdownPreview/PreviewPanel.vue index c3f6b90..8e7723b 100644 --- a/frontend/src/views/editor/extensions/markdownPreview/PreviewPanel.vue +++ b/frontend/src/views/editor/extensions/markdownPreview/PreviewPanel.vue @@ -140,11 +140,11 @@ const onMouseMove = (e: MouseEvent) => { // 获取编辑器容器高度作为最大限制 const editorView = state.value.view; - const maxHeight = editorView + const maxHeight = editorView ? (editorView.dom.parentElement?.clientHeight || editorView.dom.clientHeight) : 9999; - const newHeight = Math.max(100, Math.min(maxHeight, startHeight + delta)); + const newHeight = Math.max(10, Math.min(maxHeight, startHeight + delta)); markdownPreviewManager.updateHeight(newHeight); }; @@ -337,7 +337,7 @@ onUnmounted(() => { left: 0; right: 0; width: 100%; - min-height: 100px; + min-height: 10px; background: var(--bg-primary); border-top: 1px solid var(--border-color, rgba(255, 255, 255, 0.1)); display: flex; diff --git a/frontend/src/views/editor/extensions/markdownPreview/manager.ts b/frontend/src/views/editor/extensions/markdownPreview/manager.ts index 8b60a1e..b562d73 100644 --- a/frontend/src/views/editor/extensions/markdownPreview/manager.ts +++ b/frontend/src/views/editor/extensions/markdownPreview/manager.ts @@ -54,7 +54,7 @@ class MarkdownPreviewManager { this.state.value = { visible: true, - position: { height: Math.max(100, defaultHeight) }, + position: { height: Math.max(10, defaultHeight) }, content, blockFrom, blockTo, @@ -85,7 +85,7 @@ class MarkdownPreviewManager { this.state.value = { ...this.state.value, - position: { height: Math.max(100, height) } + position: { height: Math.max(10, height) } }; }