diff --git a/src/assets/scripts/util.js b/src/assets/scripts/util.js index b3d13db..4c83c70 100644 --- a/src/assets/scripts/util.js +++ b/src/assets/scripts/util.js @@ -213,7 +213,7 @@ export function fixCodeWhiteSpace(value = "pre") { * 下载原始 Markdown 文档 * @param {文档内容} doc */ -export function downLoadMD(doc) { +export function downloadMD(doc) { let downLink = document.createElement("a"); downLink.download = "content.md"; diff --git a/src/components/CodemirrorEditor/header.vue b/src/components/CodemirrorEditor/header.vue index bc377e7..27b62e1 100644 --- a/src/components/CodemirrorEditor/header.vue +++ b/src/components/CodemirrorEditor/header.vue @@ -9,20 +9,20 @@ @@ -160,7 +160,7 @@ plain size="medium" class="about" - @click="$emit('showAboutDialog')" + @click="$emit('show-about-dialog')" >关于 import { - downLoadMD, + downloadMD, setFontSize, fixCodeWhiteSpace, setColorWithCustomTemplate, @@ -327,7 +327,7 @@ export default { this.citeStatus = false; this.statusChanged(false); this.fontChanged(this.config.builtinFonts[0].value); - this.colorChanged(this.config.colorOption[1].value); + this.colorChanged(this.config.colorOption[0].value); this.sizeChanged(this.config.sizeOption[2].value); this.$emit("cssChanged"); this.selectFont = this.currentFont; diff --git a/src/components/CodemirrorEditor/rightClickMenu.vue b/src/components/CodemirrorEditor/rightClickMenu.vue index 067e2c2..cf9aeb2 100644 --- a/src/components/CodemirrorEditor/rightClickMenu.vue +++ b/src/components/CodemirrorEditor/rightClickMenu.vue @@ -54,8 +54,8 @@ export default { ], [ { - text: "下载MD文档", - key: "downLoad", + text: "下载 Markdown 文档", + key: "download", }, ], ], diff --git a/src/store/index.js b/src/store/index.js index a58b5c4..7a7dfb4 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -65,7 +65,7 @@ const mutations = { state.currentFont = localStorage.getItem("fonts") || config.builtinFonts[0].value; state.currentColor = - localStorage.getItem("color") || config.colorOption[1].value; + localStorage.getItem("color") || config.colorOption[0].value; state.currentSize = localStorage.getItem("size") || config.sizeOption[2].value; state.codeTheme = diff --git a/src/view/CodemirrorEditor.vue b/src/view/CodemirrorEditor.vue index 8c13dcd..2a0446a 100644 --- a/src/view/CodemirrorEditor.vue +++ b/src/view/CodemirrorEditor.vue @@ -6,11 +6,11 @@ ref="header" @refresh="onEditorRefresh" @cssChanged="cssChanged" - @downLoad="downloadEditorContent" + @download="downloadEditorContent" @showCssEditor="showCssEditor = !showCssEditor" - @showAboutDialog="aboutDialogVisible = true" + @show-about-dialog="aboutDialogVisible = true" @showDialogForm="dialogFormVisible = true" - @showDialogUploadImg="dialogUploadImgVisible = true" + @show-dialog-upload-img="dialogUploadImgVisible = true" @startCopy="(isCoping = true), (backLight = true)" @endCopy="endCopy" /> @@ -95,7 +95,8 @@ import uploadImgDialog from "../components/CodemirrorEditor/uploadImgDialog"; import { css2json, - downLoadMD, + downloadMD, + formatDoc, setFontSize, saveEditorContent, customCssWithTemplate, @@ -336,7 +337,7 @@ export default { }, // 下载编辑器内容到本地 downloadEditorContent() { - downLoadMD(this.editor.getValue(0)); + downloadMD(this.editor.getValue(0)); }, // 右键菜单 openMenu(e) { @@ -360,7 +361,7 @@ export default { case "insertPic": this.dialogUploadImgVisible = true; break; - case "downLoad": + case "download": this.downloadEditorContent(); break; case "insertTable":