修复切换子命令时,参数值被错误置为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) => { this.getSelectSubCommand(value)?.config?.forEach((config, index) => {
//
if (!config.defaultValue) return;
newArgvs[this.commonConfig.length + index] = config.defaultValue; newArgvs[this.commonConfig.length + index] = config.defaultValue;
}); });

View File

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