diff --git a/assets/scripts/editor.js b/assets/scripts/editor.js
index 7306c77..6557a56 100644
--- a/assets/scripts/editor.js
+++ b/assets/scripts/editor.js
@@ -117,13 +117,13 @@ let app = new Vue({
const markdownImage = `![](${imageUrl})`
// 将 Markdown 形式的 URL 插入编辑框光标所在位置
this.editor.replaceSelection(`\n${markdownImage}\n`, cursor);
- this.refresh();
-
this.$message({
showClose: true,
message: '图片插入成功',
type: 'success'
});
+
+ this.refresh();
} else {
// 上传失败
@@ -137,6 +137,13 @@ 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 a9ca8b4..1449543 100644
--- a/index.html
+++ b/index.html
@@ -37,7 +37,7 @@
+ accept=".jpg,.jpeg,.png,.gif" :limit="1" name="smfile" :on-success="uploaded" :on-error="failed" :on-progress="uploading">