From 7520cd258b8d84388f1b1eccb4b8bf54a0954234 Mon Sep 17 00:00:00 2001 From: jmal Date: Thu, 27 Aug 2020 22:30:17 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=EF=BC=9A=E5=86=99=E6=96=87?= =?UTF-8?q?=E7=AB=A0=E7=95=8C=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/markdown/index.vue | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/src/views/markdown/index.vue b/src/views/markdown/index.vue index f8d826b..5d21d3b 100644 --- a/src/views/markdown/index.vue +++ b/src/views/markdown/index.vue @@ -3,11 +3,11 @@ 确 定 - +
文章标题: - + 选择位置 发布文章 @@ -25,6 +25,7 @@ @save="save" @imgAdd="$imgAdd" @imgDel="$imgDel" + @fullScreen="fullScreen" />
@@ -44,9 +45,10 @@ content:"", // 输入的markdown html:'', // 及时转的html filename: '新建文档', - clientHeight: document.documentElement.clientHeight - 155, + clientHeight: document.documentElement.clientHeight - 135, updating: false, adding: false, + isFullScreen: false, storageLocation: '/', selectLocationVisible: false, } @@ -64,7 +66,7 @@ } const that = this window.onresize = function temp() { - that.clientHeight = document.documentElement.clientHeight - 155 + that.reHeight() } }, methods: { @@ -104,6 +106,17 @@ // render 为 markdown 解析后的结果[html] this.html = render; }, + fullScreen(status) { + this.isFullScreen = status + this.reHeight() + }, + reHeight(){ + if(this.isFullScreen){ + this.clientHeight = document.documentElement.clientHeight + }else{ + this.clientHeight = document.documentElement.clientHeight - 135 + } + }, save(){ if(this.editStatus){ this.update() @@ -173,9 +186,12 @@