From 0cf44c2a420233c988bae3fcd9cb38b72986bd01 Mon Sep 17 00:00:00 2001 From: Tim Date: Fri, 25 Jul 2025 10:57:29 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E8=AF=84=E8=AE=BA=E5=8C=BA=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E9=AB=98=E5=BA=A6=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- open-isle-cli/src/assets/global.css | 8 +++++++- open-isle-cli/src/components/CommentEditor.vue | 2 -- open-isle-cli/src/utils/vditor.js | 3 +-- open-isle-cli/src/views/PostPageView.vue | 1 + 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/open-isle-cli/src/assets/global.css b/open-isle-cli/src/assets/global.css index 50bd5d544..b00a56e24 100644 --- a/open-isle-cli/src/assets/global.css +++ b/open-isle-cli/src/assets/global.css @@ -57,7 +57,9 @@ body { /************************* * Vditor 自定义皮肤覆写 *************************/ - +.vditor { + min-height: 200px; +} /* .vditor { --textarea-background-color: transparent; border: none !important; @@ -200,6 +202,10 @@ body { } @media (max-width: 768px) { + .vditor { + min-height: 100px; + } + .vditor-toolbar { display: none; } diff --git a/open-isle-cli/src/components/CommentEditor.vue b/open-isle-cli/src/components/CommentEditor.vue index 4cf2d3542..46ab085f7 100644 --- a/open-isle-cli/src/components/CommentEditor.vue +++ b/open-isle-cli/src/components/CommentEditor.vue @@ -26,7 +26,6 @@ import { getPreviewTheme as getPreviewThemeUtil } from '../utils/vditor' import LoginOverlay from './LoginOverlay.vue' -import { isMobile } from '../utils/screen' export default { name: 'CommentEditor', @@ -74,7 +73,6 @@ export default { onMounted(() => { vditorInstance.value = createVditor(props.editorId, { placeholder: '说点什么...', - height: isMobile.value ? 'auto' : 200, preview: { actions: [], markdown: { toc: false } diff --git a/open-isle-cli/src/utils/vditor.js b/open-isle-cli/src/utils/vditor.js index cfa3edace..2a46a0a52 100644 --- a/open-isle-cli/src/utils/vditor.js +++ b/open-isle-cli/src/utils/vditor.js @@ -14,7 +14,6 @@ export function getPreviewTheme() { export function createVditor(editorId, options = {}) { const { placeholder = '', - height, preview = {}, input, after @@ -22,7 +21,7 @@ export function createVditor(editorId, options = {}) { return new Vditor(editorId, { placeholder, - height, + height: 'auto', theme: getEditorTheme(), preview: Object.assign({ theme: { current: getPreviewTheme() } }, preview), cdn: 'https://openisle-1307107697.cos.ap-guangzhou.myqcloud.com/assert/vditor', diff --git a/open-isle-cli/src/views/PostPageView.vue b/open-isle-cli/src/views/PostPageView.vue index 6ac524488..8a729c797 100644 --- a/open-isle-cli/src/views/PostPageView.vue +++ b/open-isle-cli/src/views/PostPageView.vue @@ -795,6 +795,7 @@ export default { display: flex; flex-direction: column; gap: 10px; + width: 100%; } .info-content-header {