diff --git a/src/components/CommandRunResult.vue b/src/components/CommandRunResult.vue index 09654d8..6e354bb 100644 --- a/src/components/CommandRunResult.vue +++ b/src/components/CommandRunResult.vue @@ -206,7 +206,7 @@ export default { setSubInput(currentCommand) { this.fromUtools && utools.setExpendHeight(0); let matched = specialVars.subinput.match.exec(currentCommand.cmd); - let placeholder = matched[1]?.slice(1) || "↩ 执行命令,↑↓ 切换历史"; + let placeholder = matched?.[1]?.slice(1) || "↩ 执行命令,↑↓ 切换历史"; utools.setSubInput(({ text }) => { this.subInputValue = text; }, placeholder);