优化Code.vue控件

This commit is contained in:
jingrow 2026-03-17 00:10:21 +08:00
parent ec5a32f907
commit 77084a0de9

View File

@ -196,8 +196,8 @@ onBeforeUnmount(disposeEditor)
.code-editor { .code-editor {
width: 100%; width: 100%;
display: grid; display: flex;
grid-template-rows: 1fr auto; flex-direction: column;
gap: 6px; gap: 6px;
} }
@ -217,10 +217,12 @@ onBeforeUnmount(disposeEditor)
.code-editor__monaco-wrap.collapsed { .code-editor__monaco-wrap.collapsed {
height: auto; height: auto;
min-height: 150px;
} }
.code-editor__monaco-wrap:not(.collapsed) { .code-editor__monaco-wrap:not(.collapsed) {
height: auto; height: auto;
min-height: 400px;
} }
/* 只读模式样式 */ /* 只读模式样式 */
@ -231,12 +233,14 @@ onBeforeUnmount(disposeEditor)
.code-editor__monaco-host { .code-editor__monaco-host {
width: 100%; width: 100%;
height: 100%; min-height: 150px;
height: 300px;
} }
.code-editor__preview { .code-editor__preview {
width: 100%; width: 100%;
height: 100%; min-height: 120px;
max-height: 400px;
padding: 12px; padding: 12px;
overflow: auto; overflow: auto;
} }