From f9ea1bec3fa915eb192200fb819c9c9c9fb4731b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B5=94=E9=98=B3=E9=99=8C=E5=AE=A2?= Date: Fri, 5 Apr 2024 21:16:33 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=BA=E8=A1=A8=E5=8D=95=E6=8F=90=E4=BE=9B?= =?UTF-8?q?=E7=A6=81=E7=94=A8=E5=92=8C=E5=90=AF=E7=94=A8=E7=9A=84=E6=96=B9?= =?UTF-8?q?=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/libs/setting-utils.ts | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/libs/setting-utils.ts b/src/libs/setting-utils.ts index 323443b..17a850b 100644 --- a/src/libs/setting-utils.ts +++ b/src/libs/setting-utils.ts @@ -81,6 +81,27 @@ export class SettingUtils { } } + /** + * Disable setting item + * @param key key name + */ + disable(key: string) { + let element = this.elements.get(key) as any; + if (element) { + element.disabled = true; + } + } + /** + * Enable setting item + * @param key key name + */ + enable(key: string) { + let element = this.elements.get(key) as any; + if (element) { + element.disabled = false; + } + } + /** * 将设置项目导出为 JSON 对象 * @returns object