-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🚧 WIP: add support for URL uploading
- Loading branch information
1 parent
024d9cf
commit 23ba233
Showing
9 changed files
with
104 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
<template> | ||
<el-dialog | ||
:title="inputBoxOptions.title || '输入框'" | ||
:visible.sync="showInputBoxVisible" | ||
:modal-append-to-body="false" | ||
@close="handleInputBoxClose" | ||
> | ||
<el-input | ||
v-model="inputBoxValue" | ||
:placeholder="inputBoxOptions.placeholder"></el-input> | ||
<span slot="footer"> | ||
<el-button @click="showInputBoxVisible = false" round>取消</el-button> | ||
<el-button type="primary" @click="showInputBoxVisible = false" round>确定</el-button> | ||
</span> | ||
</el-dialog> | ||
</template> | ||
<script lang="ts"> | ||
import { Component, Vue } from 'vue-property-decorator' | ||
import { remote, ipcRenderer, IpcRendererEvent } from 'electron' | ||
import { | ||
SHOW_INPUT_BOX, | ||
SHOW_INPUT_BOX_RESPONSE | ||
} from '~/universal/events/constants' | ||
@Component({ | ||
name: 'input-box-dialog' | ||
}) | ||
export default class extends Vue { | ||
inputBoxValue = '' | ||
showInputBoxVisible = false | ||
inputBoxOptions = { | ||
title: '', | ||
placeholder: '' | ||
} | ||
created () { | ||
ipcRenderer.on(SHOW_INPUT_BOX, this.ipcEventHandler) | ||
this.$bus.$on(SHOW_INPUT_BOX, this.initInputBoxValue) | ||
} | ||
ipcEventHandler (evt: IpcRendererEvent, options: IShowInputBoxOption) { | ||
this.initInputBoxValue(options) | ||
} | ||
initInputBoxValue (options: IShowInputBoxOption) { | ||
this.inputBoxValue = '' | ||
this.inputBoxOptions.title = options.title || '' | ||
this.inputBoxOptions.placeholder = options.placeholder || '' | ||
this.showInputBoxVisible = true | ||
} | ||
handleInputBoxClose () { | ||
// TODO: RPCServer | ||
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) | ||
} | ||
} | ||
</script> | ||
<style lang='stylus'> | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
import Vue from 'vue' | ||
export default new Vue() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export const SHOW_INPUT_BOX = 'SHOW_INPUT_BOX' | ||
export const SHOW_INPUT_BOX_RESPONSE = 'SHOW_INPUT_BOX_RESPONSE' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters