build: release v1.4.4

This commit is contained in:
yanglbme 2020-11-23 23:28:28 +08:00
parent d95e098c22
commit ba577270f4
3 changed files with 16 additions and 2 deletions

View File

@ -1,9 +1,9 @@
{ {
"name": "vue-md", "name": "vue-md",
"version": "1.4.3", "version": "1.4.4",
"homepage": ".", "homepage": ".",
"description": "An open-source wechat markdown editor.", "description": "An open-source wechat markdown editor.",
"author": "yanglbme <contact@yanglibin.info>", "author": "doocs",
"scripts": { "scripts": {
"serve": "vue-cli-service serve", "serve": "vue-cli-service serve",
"build": "vue-cli-service build", "build": "vue-cli-service build",

View File

@ -57,6 +57,10 @@ export default {
text: "下载 Markdown 文档", text: "下载 Markdown 文档",
key: "download", key: "download",
}, },
{
text: "格式化 Markdown 文档",
key: "formatMarkdown",
},
], ],
], ],
}; };

View File

@ -339,6 +339,12 @@ export default {
downloadEditorContent() { downloadEditorContent() {
downloadMD(this.editor.getValue(0)); downloadMD(this.editor.getValue(0));
}, },
//
formatContent() {
const doc = formatDoc(this.editor.getValue(0));
localStorage.setItem("__editor_content", doc);
this.editor.setValue(doc);
},
// //
openMenu(e) { openMenu(e) {
const menuMinWidth = 105; const menuMinWidth = 105;
@ -366,6 +372,10 @@ export default {
break; break;
case "insertTable": case "insertTable":
this.dialogFormVisible = true; this.dialogFormVisible = true;
break;
case "formatMarkdown":
this.formatContent();
break;
default: default:
break; break;
} }