修复切换子命令时,参数值被错误置为null的bug

This commit is contained in:
fofolee
2025-02-24 12:47:08 +08:00
parent d70a04f549
commit 0e43a3eac8
2 changed files with 4 additions and 2 deletions

View File

@@ -98,6 +98,8 @@ export default defineComponent({
// 使用新选择的函数独有配置的默认值
this.getSelectSubCommand(value)?.config?.forEach((config, index) => {
// 有默认值时才更新
if (!config.defaultValue) return;
newArgvs[this.commonConfig.length + index] = config.defaultValue;
});

View File

@@ -205,7 +205,7 @@ export default defineComponent({
computed: {
isString: {
get() {
return this.modelValue.isString;
return this.modelValue?.isString;
},
set(value) {
this.$emit("update:modelValue", {
@@ -225,7 +225,7 @@ export default defineComponent({
inputValue: {
get() {
return this.modelValue.value;
return this.modelValue?.value;
},
set(value) {
this.$emit("update:modelValue", {