修复更改subcommand时,output不变更的bug

This commit is contained in:
fofolee 2025-02-12 23:55:07 +08:00
parent 2cb0c6bb32
commit a8c3528566
2 changed files with 5 additions and 2 deletions

View File

@ -220,7 +220,10 @@ export default defineComponent({
code: this.generateCode(subCommand, argvs),
};
if (resetOutputVariable) {
delete newModelValue.outputVariable;
newModelValue.outputVariable = {
name: "",
details: {},
};
}
this.$emit("update:modelValue", newModelValue);
},

View File

@ -200,7 +200,7 @@ export default defineComponent({
currentSubCommand() {
if (!this.command.subCommands) return {};
return this.command.subCommands.find(
(cmd) => cmd.value === this.command.value
(cmd) => cmd.value === this.command.subCommand
);
},
commandName() {