From e8f362fc4596b50ae608799435d62952d8fbe0fc Mon Sep 17 00:00:00 2001 From: "xinxin.wu" Date: Wed, 8 May 2024 21:57:24 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95):=20?= =?UTF-8?q?=E4=BF=AE=E6=94=B9CSS=E5=8D=95=E8=AF=8D=E5=B0=8F=E9=A9=BC?= =?UTF-8?q?=E5=B3=B0=E7=BC=96=E8=AF=91=E4=B8=8D=E9=80=9A=E8=BF=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/pure/ms-code-editor/index.vue | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/frontend/src/components/pure/ms-code-editor/index.vue b/frontend/src/components/pure/ms-code-editor/index.vue index 399c8c29e3..a82b962b76 100644 --- a/frontend/src/components/pure/ms-code-editor/index.vue +++ b/frontend/src/components/pure/ms-code-editor/index.vue @@ -253,12 +253,12 @@ function getEncodingCode() { return editor.getValue(); } - - const innerHeight = ref(); + // @desc 这里未使用小驼峰 否则CSS绑定时候报错 + const codeheight = ref(); function handleEditorMount() { if (!props.isAdaptive) { - innerHeight.value = props.height; + codeheight.value = props.height; return; } const editorElement = editor.getDomNode(); @@ -273,9 +273,9 @@ const lineCount = editor.getModel()?.getLineCount() || 10; // 计算高度 @desc 原本行数差3行完全展示文本 24为上下的边距为12px const height = (lineCount + 3) * lineHeight; - innerHeight.value = height > 300 ? `${height + 24}px` : '300px'; + codeheight.value = height > 300 ? `${height + 24}px` : '300px'; if (height > 1000) { - innerHeight.value = `1000px`; + codeheight.value = `1000px`; } editor.layout(); } @@ -383,7 +383,7 @@ redo, format, getEncodingCode, - innerHeight, + codeheight, handleEditorMount, }; }, @@ -393,7 +393,7 @@