Skip to content

Commit

Permalink
build: release v1.4.4
Browse files Browse the repository at this point in the history
  • Loading branch information
yanglbme committed Nov 23, 2020
1 parent d95e098 commit ba57727
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"name": "vue-md",
"version": "1.4.3",
"version": "1.4.4",
"homepage": ".",
"description": "An open-source wechat markdown editor.",
"author": "yanglbme <contact@yanglibin.info>",
"author": "doocs",
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
Expand Down
4 changes: 4 additions & 0 deletions src/components/CodemirrorEditor/rightClickMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ export default {
text: "下载 Markdown 文档",
key: "download",
},
{
text: "格式化 Markdown 文档",
key: "formatMarkdown",
},
],
],
};
Expand Down
10 changes: 10 additions & 0 deletions src/view/CodemirrorEditor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,12 @@ export default {
downloadEditorContent() {
downloadMD(this.editor.getValue(0));
},
// 格式化文档
formatContent() {
const doc = formatDoc(this.editor.getValue(0));
localStorage.setItem("__editor_content", doc);
this.editor.setValue(doc);
},
// 右键菜单
openMenu(e) {
const menuMinWidth = 105;
Expand Down Expand Up @@ -366,6 +372,10 @@ export default {
break;
case "insertTable":
this.dialogFormVisible = true;
break;
case "formatMarkdown":
this.formatContent();
break;
default:
break;
}
Expand Down

0 comments on commit ba57727

Please sign in to comment.