From ddee4a501726fc46b95a931cdf91f5987ee4f475 Mon Sep 17 00:00:00 2001 From: fofolee Date: Mon, 24 Feb 2025 18:50:56 +0800 Subject: [PATCH] =?UTF-8?q?=E9=9D=9E=E5=85=B3=E9=94=AE=E5=AD=97=E7=9A=84cm?= =?UTF-8?q?d.label=E5=9D=87=E4=BD=BF=E7=94=A8explain?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/js/commandManager.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/js/commandManager.js b/src/js/commandManager.js index ebef0a2..a1ce18a 100644 --- a/src/js/commandManager.js +++ b/src/js/commandManager.js @@ -42,7 +42,8 @@ const getLabeledCmds = (cmds, explain) => { } return { ...cmd, - label: cmd.label || explain, + // 非关键字的cmd.label均使用explain + label: explain, }; }); }; @@ -52,7 +53,7 @@ const getValidCommand = (command) => { if (!explain) throw "名称不能为空"; if (!Array.isArray(cmds)) throw "匹配规则格式错误"; - // 未配置label或关键字时,直接使用名称 + // 根据explain设置label和关键字 command.features.cmds = getLabeledCmds(cmds, explain); // 不需要显示输入框的输入类型,添加mainHide属性