From 9af82bea838716b2ef58ed52885866e13ffbcbea Mon Sep 17 00:00:00 2001 From: keep <1603421097@qq.com> Date: Sat, 18 Apr 2026 22:30:00 +0800 Subject: [PATCH 1/2] =?UTF-8?q?feat(editor):=20=E6=B7=BB=E5=8A=A0=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E8=87=AA=E5=8A=A8=E4=BF=9D=E5=AD=98=E5=92=8C=E5=88=86?= =?UTF-8?q?=E4=BA=AB=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 添加自动保存编辑器状态到本地存储功能 实现通过URL分享代码功能 新增格式化代码和分享按钮 --- editor/index.html | 10 ++- editor/index.js | 220 ++++++++++++++++++++++++++++++++++++++++++---- 2 files changed, 208 insertions(+), 22 deletions(-) diff --git a/editor/index.html b/editor/index.html index ede19d9..cd160f6 100644 --- a/editor/index.html +++ b/editor/index.html @@ -3,12 +3,11 @@ + + - - - @@ -30,6 +29,11 @@

Editor

+
+ + + +
-
+
-
+
diff --git a/editor/index.js b/editor/index.js index 5e7a98b..eec3396 100644 --- a/editor/index.js +++ b/editor/index.js @@ -292,6 +292,8 @@ function loadCodeWithMode(modeId, code) { $('#editor').empty(); editor = monaco.editor.create(document.getElementById('editor'), { model: null, + automaticLayout: true, + scrollBeyondLastLine: false, }); setupAutoSave(); }