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)