From 52db26651fb8ef522f8713574a7011911d1ba4a5 Mon Sep 17 00:00:00 2001 From: engigu Date: Thu, 26 Mar 2026 14:46:18 +0800 Subject: [PATCH] chore: update editor canceld js --- web/src/views/editor/Editor.vue | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/web/src/views/editor/Editor.vue b/web/src/views/editor/Editor.vue index 23290a5..c144584 100644 --- a/web/src/views/editor/Editor.vue +++ b/web/src/views/editor/Editor.vue @@ -115,7 +115,16 @@ async function fetchPaths() { const editorRef = shallowRef() const isSmallScreen = ref(window.innerWidth < 1024) -const editorFontSize = computed(() => isSmallScreen.value ? 12 : 13) + +const editorOptions = computed(() => ({ + minimap: { enabled: false }, + fontSize: isSmallScreen.value ? 12 : 13, + lineNumbers: 'on' as const, + scrollBeyondLastLine: false, + readOnly: !isEditMode.value, + domReadOnly: !isEditMode.value, + automaticLayout: true, +})) function handleEditorMount(editor: any) { editorRef.value = editor @@ -473,14 +482,7 @@ onUnmounted(() => {
+ theme="vs-dark" :options="editorOptions" @mount="handleEditorMount" />
从上方选择文件开始编辑