diff --git a/src-electron/main-process/api.js b/src-electron/main-process/api.js index 84081c6..80008a3 100644 --- a/src-electron/main-process/api.js +++ b/src-electron/main-process/api.js @@ -49,10 +49,10 @@ export default { /** * export single note */ - handleApi('export-markdown-file', (event, content) => { + handleApi('export-markdown-file', (event, { content, title }) => { return dialog.showSaveDialog({ title: 'Export', - defaultPath: app.getPath('documents'), + defaultPath: path.join(app.getPath('documents'), `${title}`), filters: [ { name: 'Markdown File', @@ -78,10 +78,10 @@ export default { }) }).catch(err => throw err) }).catch(err => throw err) - handleApi('export-png', (event, content) => { + handleApi('export-png', (event, { content, title }) => { return dialog.showSaveDialog({ title: 'Export', - defaultPath: app.getPath('documents'), + defaultPath: path.join(app.getPath('documents'), `${title}`), filters: [ { name: 'Portable Network Graphics', diff --git a/src/components/Header.vue b/src/components/Header.vue index 0d5f170..a0404e2 100644 --- a/src/components/Header.vue +++ b/src/components/Header.vue @@ -41,15 +41,8 @@ > {{ $t('noteCategory') }} - - {{ $t('noteCategory') }} @@ -70,42 +63,11 @@ > {{ $t('tag') }} - - {{ $t('tag') }} - - - {{ enablePreviewEditor ? $t('lock') : $t('unlock') }} - - {{ enablePreviewEditor ? $t('lock') : $t('unlock') }} - - {{ isLogin ? $t('logout') : $t('login') }} - - {{ isLogin ? $t('logout') : $t('login') }} @@ -155,15 +110,8 @@ /> {{ $t('search') }} - - {{ $t('search') }} @@ -197,15 +145,8 @@ > {{ $t('switchView') }} - - {{ $t('switchView') }} @@ -216,10 +157,7 @@ @click="$refs.settingsDialog.toggle()" > - {{ $t('settings') }} - - {{ $t('settings') }} @@ -356,12 +294,6 @@ export default { value: !this.noteListVisible }) }, - lockModeHandler: function () { - this.toggleChanged({ - key: 'enablePreviewEditor', - value: !this.enablePreviewEditor - }) - }, clearInputHandler: function () { this.searchText = '' this.getCategoryNotes({ category: this.currentCategory }) @@ -379,7 +311,6 @@ export default { this.$refs.loginDialog.toggle() } bus.$on(events.VIEW_SHORTCUT_CALL.switchView, this.switchViewHandler) - bus.$on(events.VIEW_SHORTCUT_CALL.lockMode, this.lockModeHandler) }, watch: { isLogin: function (currentData) { @@ -392,7 +323,6 @@ export default {