From 3d2d15e177e55104732db3dc864ad19243dbefd0 Mon Sep 17 00:00:00 2001 From: fofolee Date: Wed, 23 Apr 2025 18:58:04 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0option=E7=9A=84=E7=A9=BA?= =?UTF-8?q?=E5=80=BC=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.vue | 8 ++++---- src/components/CommandRunResult.vue | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/App.vue b/src/App.vue index aea84fd..6359b9e 100644 --- a/src/App.vue +++ b/src/App.vue @@ -173,10 +173,10 @@ export default defineComponent({ } else { let option = command.program === "custom" - ? command.customOptions - : this.programs[command.program]; - option.scptarg = command.scptarg; - option.charset = command.charset; + ? command.customOptions || {} + : this.programs[command.program] || {}; + option.scptarg = command.scptarg || ""; + option.charset = command.charset || {}; window.runCodeFile( commandCode, option, diff --git a/src/components/CommandRunResult.vue b/src/components/CommandRunResult.vue index a8c5856..e24e5ac 100644 --- a/src/components/CommandRunResult.vue +++ b/src/components/CommandRunResult.vue @@ -170,8 +170,8 @@ export default { getCommandOpt(command) { let option = command.program === "custom" - ? command.customOptions - : programs[command.program]; + ? command.customOptions || {} + : programs[command.program] || {}; option.scptarg = command.scptarg || ""; option.charset = command.charset || {}; option.envPath = this.$root.nativeProfile.envPath.trim() || "";