From 0be0c8dd8830a611ba4a6c63ddcab2fcf02747b0 Mon Sep 17 00:00:00 2001 From: fofolee Date: Sat, 23 Apr 2022 09:58:46 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AD=90=E8=BE=93=E5=85=A5=E6=A1=86=E8=BE=93?= =?UTF-8?q?=E5=85=A5=E5=90=8E=E6=B8=85=E6=A5=9A=E4=B8=8A=E4=B8=80=E6=AC=A1?= =?UTF-8?q?=E7=9A=84=E4=BA=8B=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/CommandRunResult.vue | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/components/CommandRunResult.vue b/src/components/CommandRunResult.vue index 0bc48d1..99790cc 100644 --- a/src/components/CommandRunResult.vue +++ b/src/components/CommandRunResult.vue @@ -166,6 +166,7 @@ export default { this.history.push(this.subInputValue); this.historyIdx = this.history.length; utools.setSubInputValue(""); + this.clear(); this.fire(command); }; // 自动粘贴的情况下自动执行 @@ -239,19 +240,22 @@ export default { }, stopRun() { this.runResult = ""; - if (!!this.child) { - quickcommand.kill(this.child.pid); - } - quickcommand.closeWaitBtn?.(); - quickcommand.closeWaitBtn = () => {}; if (!!this.subInputListener) { this.subInputValue = ""; utools.removeSubInput(); document.removeEventListener("keydown", this.subInputListener, true); } + this.clear(); + }, + clear() { if (!!this.quickcommandListener) { document.removeEventListener("keydown", this.quickcommandListener); } + if (!!this.child) { + quickcommand.kill(this.child.pid); + } + quickcommand.closeWaitBtn?.(); + quickcommand.closeWaitBtn = () => {}; }, }, unmounted() {