From 326192edf099d69db00a89d4cbcd71132aa01b14 Mon Sep 17 00:00:00 2001 From: JimQing Date: Mon, 13 Jul 2020 00:26:29 +0800 Subject: [PATCH] add: add right-side menu --- src/assets/scripts/util.js | 13 ++ .../CodemirrorEditor/aboutDialog.vue | 4 +- src/components/CodemirrorEditor/header.vue | 20 +-- .../CodemirrorEditor/insertForm.vue | 8 +- .../CodemirrorEditor/rightClickMenu.vue | 142 ++++++++++++++++++ src/view/CodemirrorEditor.vue | 106 +++++++++---- 6 files changed, 246 insertions(+), 47 deletions(-) create mode 100644 src/components/CodemirrorEditor/rightClickMenu.vue diff --git a/src/assets/scripts/util.js b/src/assets/scripts/util.js index c70174e..5520ecc 100644 --- a/src/assets/scripts/util.js +++ b/src/assets/scripts/util.js @@ -213,4 +213,17 @@ export function fixCodeWhiteSpace(value = 'pre') { pre.style.whiteSpace = value; }) } +} + +export function downLoadMD(doc) { + let downLink = document.createElement('a'); + + downLink.download = 'content.md'; + downLink.style.display = 'none'; + let blob = new Blob([doc]); + + downLink.href = URL.createObjectURL(blob); + document.body.appendChild(downLink); + downLink.click(); + document.body.removeChild(downLink); } \ No newline at end of file diff --git a/src/components/CodemirrorEditor/aboutDialog.vue b/src/components/CodemirrorEditor/aboutDialog.vue index dc4d8d3..67a90fe 100644 --- a/src/components/CodemirrorEditor/aboutDialog.vue +++ b/src/components/CodemirrorEditor/aboutDialog.vue @@ -1,5 +1,5 @@