From 42153d0c9554dc7dbbfacf3c745227f2486046b6 Mon Sep 17 00:00:00 2001 From: fofolee Date: Tue, 31 Dec 2024 00:20:13 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=A4=9A=E8=BE=93=E5=85=A5?= =?UTF-8?q?=E6=A1=86=E7=BB=84=E4=BB=B6bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugin/lib/quickcomposer/textProcessing.js | 2 +- src/components/composer/ui/MultiParamInput.vue | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/plugin/lib/quickcomposer/textProcessing.js b/plugin/lib/quickcomposer/textProcessing.js index dff40d0..03562a0 100644 --- a/plugin/lib/quickcomposer/textProcessing.js +++ b/plugin/lib/quickcomposer/textProcessing.js @@ -97,7 +97,7 @@ const textProcessing = { }, // 字符串替换 replaceString: function (text, oldStr, newStr) { - return text.replace(oldStr, newStr); + return text.replaceAll(oldStr, newStr); }, // 字符串截取 substring: function (text, start, end) { diff --git a/src/components/composer/ui/MultiParamInput.vue b/src/components/composer/ui/MultiParamInput.vue index 7365391..c625d54 100644 --- a/src/components/composer/ui/MultiParamInput.vue +++ b/src/components/composer/ui/MultiParamInput.vue @@ -44,14 +44,14 @@ export default defineComponent({ handleArgvChange(key, value) { // 收集所有参数的当前值 const args = this.config.reduce((acc, item) => { - acc[item.key] = item.key === key ? value : item.value || ""; + acc[item.key] = item.key === key ? value : item.value ?? ""; return acc; }, {}); // 按照配置顺序拼接参数值 const argv = this.config .map((item) => args[item.key]) - .filter(Boolean) + .filter((val) => val !== undefined && val !== "") .join(","); this.$emit("update:modelValue", argv);