From 32334e9bc13bdd4ab6d48ff52a82e520f6674c62 Mon Sep 17 00:00:00 2001 From: Molunerfinn Date: Tue, 25 Feb 2020 20:58:39 +0800 Subject: [PATCH] :bug: Fix: correct inputbox value && remove listener --- src/renderer/components/InputBoxDialog.vue | 13 +++++++++---- src/renderer/pages/Upload.vue | 1 + 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/renderer/components/InputBoxDialog.vue b/src/renderer/components/InputBoxDialog.vue index 886a2ae2..a8c373ea 100644 --- a/src/renderer/components/InputBoxDialog.vue +++ b/src/renderer/components/InputBoxDialog.vue @@ -3,14 +3,13 @@ :title="inputBoxOptions.title || '输入框'" :visible.sync="showInputBoxVisible" :modal-append-to-body="false" - @close="handleInputBoxClose" > - 取消 - 确定 + 取消 + 确定 @@ -44,11 +43,17 @@ export default class extends Vue { this.inputBoxOptions.placeholder = options.placeholder || '' this.showInputBoxVisible = true } - handleInputBoxClose () { + handleInputBoxCancel () { // TODO: RPCServer + this.showInputBoxVisible = false ipcRenderer.send(SHOW_INPUT_BOX, '') this.$bus.$emit(SHOW_INPUT_BOX_RESPONSE, '') } + handleInputBoxConfirm () { + this.showInputBoxVisible = false + ipcRenderer.send(SHOW_INPUT_BOX, this.inputBoxValue) + this.$bus.$emit(SHOW_INPUT_BOX_RESPONSE, this.inputBoxValue) + } beforeDestroy () { ipcRenderer.removeListener(SHOW_INPUT_BOX, this.ipcEventHandler) this.$bus.$off(SHOW_INPUT_BOX) diff --git a/src/renderer/pages/Upload.vue b/src/renderer/pages/Upload.vue index feacb4fc..fca3fcae 100644 --- a/src/renderer/pages/Upload.vue +++ b/src/renderer/pages/Upload.vue @@ -115,6 +115,7 @@ export default class extends Vue { } } beforeDestroy () { + this.$bus.$off(SHOW_INPUT_BOX_RESPONSE) ipcRenderer.removeAllListeners('uploadProgress') ipcRenderer.removeAllListeners('syncPicBed') ipcRenderer.removeListener('getPicBeds', this.getPicBeds)