diff --git a/README.md b/README.md index 1a3850b..7cccf13 100644 --- a/README.md +++ b/README.md @@ -38,6 +38,8 @@ Markdown 文档自动即时渲染为微信图文,让你不再为微信文章 ![custom](./assets/images/doocs-md-custom-css.gif) +![doocs-md-upload-image](./assets/images/doocs-md-upload-image.gif) + ## 示例文章 - [ES6 特性快速扫盲](https://mp.weixin.qq.com/s/I3EzOO0skf8xDCGtyYM5Lg) - [GitHub 项目持续本地化,交给它来做,准没错!](https://mp.weixin.qq.com/s/KO4xHr4EI0YfjF0hiT3pbw) diff --git a/assets/images/doocs-md-upload-image.gif b/assets/images/doocs-md-upload-image.gif new file mode 100644 index 0000000..4d38e5a Binary files /dev/null and b/assets/images/doocs-md-upload-image.gif differ diff --git a/assets/scripts/editor.js b/assets/scripts/editor.js index 808010c..3967abe 100644 --- a/assets/scripts/editor.js +++ b/assets/scripts/editor.js @@ -100,7 +100,6 @@ let app = new Vue({ } }, methods: { - renderWeChat(source) { let output = marked(source, { renderer: this.wxRenderer.getRenderer(this.status) }); // 去除第一行的 margin-top @@ -148,7 +147,7 @@ let app = new Vue({ if (response.success) { // 上传成功,获取光标 const cursor = this.editor.getCursor(); - const imageUrl = response.data.url + const imageUrl = response.data const markdownImage = `![](${imageUrl})` // 将 Markdown 形式的 URL 插入编辑框光标所在位置 this.editor.replaceSelection(`\n${markdownImage}\n`, cursor); @@ -157,9 +156,7 @@ let app = new Vue({ message: '图片插入成功', type: 'success' }); - this.refresh(); - } else { // 上传失败 this.$message({ @@ -172,13 +169,6 @@ let app = new Vue({ failed(error, file, fileList) { console.log(error) }, - uploading(event, file, fileList) { - this.$message({ - showClose: true, - message: '图片上传中...', - type: 'info' - }); - }, // 刷新右侧预览 refresh() { this.output = this.renderWeChat(this.editor.getValue(0)); diff --git a/index.html b/index.html index 97bcef2..424187e 100644 --- a/index.html +++ b/index.html @@ -43,10 +43,9 @@ - +