From 9e0a7c083d0fb5aafea5ab07ab8e93ecadf5bbe2 Mon Sep 17 00:00:00 2001 From: ZF sun <34314687@qq.com> Date: Fri, 15 May 2026 15:45:45 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20config.js=20=E6=94=AF=E6=8C=81=20isLock?= =?UTF-8?q?ed=20=E9=85=8D=E7=BD=AE=EF=BC=8C=E9=94=81=E5=AE=9A=E4=BB=85?= =?UTF-8?q?=E9=99=90=E5=88=B6=E4=BD=8D=E7=BD=AE=E4=B8=8D=E5=BD=B1=E5=93=8D?= =?UTF-8?q?=E7=BC=96=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- js/config.js | 9 ++++++--- js/script.js | 4 ++++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/js/config.js b/js/config.js index e65b5e7..be6b36b 100644 --- a/js/config.js +++ b/js/config.js @@ -16,7 +16,8 @@ var INPUTS_CONFIG = { "left": 100, "top": 218.4, "fontWeight": 700, - "placeholder": "请输入" + "placeholder": "请输入", + "isLocked": false // true=锁定位置(不可拖动,仍可编辑), false=自由拖动 }, { "id": "input2", @@ -24,7 +25,8 @@ var INPUTS_CONFIG = { "left": 100, "top": 261.4, "fontWeight": 700, - "placeholder": "请输入" + "placeholder": "请输入", + "isLocked": false // true=锁定位置(不可拖动,仍可编辑), false=自由拖动 }, { "id": "input3", @@ -32,7 +34,8 @@ var INPUTS_CONFIG = { "left": 100, "top": 308.1, "fontWeight": 700, - "placeholder": "请输入" + "placeholder": "请输入", + "isLocked": false // true=锁定位置(不可拖动,仍可编辑), false=自由拖动 } ] }; diff --git a/js/script.js b/js/script.js index 705ae47..e5095ec 100644 --- a/js/script.js +++ b/js/script.js @@ -274,6 +274,10 @@ el.style.top = cfg.top + 'px'; if (cfg.fontWeight) el.style.fontWeight = cfg.fontWeight; if (cfg.placeholder) el.dataset.placeholder = cfg.placeholder; + if (cfg.isLocked) { + el.classList.add('locked'); + el.dataset.locked = 'true'; + } } }); }