支持单独运行命令并答应输出

This commit is contained in:
fofolee
2024-12-30 14:39:08 +08:00
parent 29d7064afc
commit 45624412bf
3 changed files with 85 additions and 9 deletions

View File

@@ -46,6 +46,7 @@
@toggle-output="toggleSaveOutput(index)"
@update:argv="(val) => handleArgvChange(index, val)"
@update:command="(val) => updateCommand(index, val)"
@run="handleRunCommand"
/>
</div>
</transition>
@@ -242,6 +243,18 @@ export default defineComponent({
};
this.$emit("update:modelValue", newCommands);
},
handleRunCommand(command) {
// 创建一个临时的命令流程
const tempFlow = [
command,
{
value: "console.log",
argv: command.outputVariable,
},
];
// 触发运行事件
this.$emit("action", "run", tempFlow);
},
},
});
</script>