From 89e426e522ba61950659fc57f59e46f421647ae3 Mon Sep 17 00:00:00 2001 From: wanglin2 <1013335014@qq.com> Date: Tue, 18 Oct 2022 09:40:34 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=9C=AC=E5=9C=B0=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E7=BC=96=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.html | 2 +- web/src/pages/Edit/components/Toolbar.vue | 19 +++++++++++++------ 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/index.html b/index.html index 6529e4ca..3cb789fb 100644 --- a/index.html +++ b/index.html @@ -1 +1 @@ -一个简单的web思维导图实现
\ No newline at end of file +一个简单的web思维导图实现
\ No newline at end of file diff --git a/web/src/pages/Edit/components/Toolbar.vue b/web/src/pages/Edit/components/Toolbar.vue index 85183fd6..c87736a7 100644 --- a/web/src/pages/Edit/components/Toolbar.vue +++ b/web/src/pages/Edit/components/Toolbar.vue @@ -260,9 +260,9 @@ export default { let [ _fileHandle ] = await window.showOpenFilePicker({ types: [ { - description: 'file', + description: '', accept: { - 'application/*': ['.json', '.smm'] + 'application/json': ['.smm'] } }, ], @@ -280,7 +280,10 @@ export default { this.readFile(); } catch (error) { console.log(error); - this.$message.warning('你的浏览器可能不支持哦'); + if (error.toString().includes('aborted')) { + return + } + this.$message.warning('你的浏览器可能不支持,建议使用最新版本的Chrome浏览器'); } }, @@ -379,9 +382,10 @@ export default { try { let _fileHandle = await window.showSaveFilePicker({ types: [{ - description: 'file', - accept: {'application/*': ['.json', '.smm']}, + description: '', + accept: {'application/json': ['.smm']}, }], + suggestedName: '思维导图' }); if (!_fileHandle) { return; @@ -400,7 +404,10 @@ export default { loading.close(); } catch (error) { console.log(error); - this.$message.warning('你的浏览器可能不支持哦'); + if (error.toString().includes('aborted')) { + return + } + this.$message.warning('你的浏览器可能不支持,建议使用最新版本的Chrome浏览器'); } }, }