Skip to content

Commit

Permalink
fix(image): add tip for failing to download online image
Browse files Browse the repository at this point in the history
  • Loading branch information
pearmini committed Nov 29, 2021
1 parent 31bfbc0 commit 082ed92
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions src/pages/Editor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,7 @@
</div>
<div class="tools-container">
<el-tooltip effect="dark" content="Story" placement="top">
<el-button
type="primary"
icon="el-icon-present"
circle
@click="handleHelp"
></el-button>
<el-button type="primary" icon="el-icon-present" circle @click="handleHelp"></el-button>
</el-tooltip>
<el-tooltip effect="dark" content="Preveiw" placement="top">
<el-button type="primary" icon="el-icon-view" circle @click="handlePreview"></el-button>
Expand Down Expand Up @@ -109,7 +104,16 @@ export default {
set(this.example, key, value);
},
handleDownloadImage() {
downloadImage(this.canvas, "wallpaper");
try {
downloadImage(this.canvas, "wallpaper");
} catch (e) {
Message.info({
message:
"The online image can't be downloaded, You can take a screenshot in preview mode or upload local image!",
duration: 5000,
});
console.log(e);
}
},
handleDownloadFile() {
downloadFile(this.example, "index");
Expand Down

0 comments on commit 082ed92

Please sign in to comment.