mirror of
https://github.com/fofolee/uTools-quickcommand.git
synced 2025-06-29 12:22:44 +08:00
修复多输入框组件bug
This commit is contained in:
parent
a2a3dbe0b6
commit
42153d0c95
@ -97,7 +97,7 @@ const textProcessing = {
|
|||||||
},
|
},
|
||||||
// 字符串替换
|
// 字符串替换
|
||||||
replaceString: function (text, oldStr, newStr) {
|
replaceString: function (text, oldStr, newStr) {
|
||||||
return text.replace(oldStr, newStr);
|
return text.replaceAll(oldStr, newStr);
|
||||||
},
|
},
|
||||||
// 字符串截取
|
// 字符串截取
|
||||||
substring: function (text, start, end) {
|
substring: function (text, start, end) {
|
||||||
|
@ -44,14 +44,14 @@ export default defineComponent({
|
|||||||
handleArgvChange(key, value) {
|
handleArgvChange(key, value) {
|
||||||
// 收集所有参数的当前值
|
// 收集所有参数的当前值
|
||||||
const args = this.config.reduce((acc, item) => {
|
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;
|
return acc;
|
||||||
}, {});
|
}, {});
|
||||||
|
|
||||||
// 按照配置顺序拼接参数值
|
// 按照配置顺序拼接参数值
|
||||||
const argv = this.config
|
const argv = this.config
|
||||||
.map((item) => args[item.key])
|
.map((item) => args[item.key])
|
||||||
.filter(Boolean)
|
.filter((val) => val !== undefined && val !== "")
|
||||||
.join(",");
|
.join(",");
|
||||||
|
|
||||||
this.$emit("update:modelValue", argv);
|
this.$emit("update:modelValue", argv);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user