From e0586c1c64491828e327b8a2481b4383d428cf3e Mon Sep 17 00:00:00 2001 From: jmal Date: Tue, 21 Jul 2020 11:52:37 +0800 Subject: [PATCH] =?UTF-8?q?*=E6=B7=BB=E5=8A=A0=E5=8A=9F=E8=83=BD:=E5=8F=8C?= =?UTF-8?q?=E5=87=BBtitle,=E6=94=BE=E5=A4=A7=E6=88=96=E7=BC=A9=E5=B0=8F?= =?UTF-8?q?=E6=96=87=E6=9C=AC=E7=BC=96=E8=BE=91=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/preview/SimTextPreview.vue | 14 ++++++++++++-- src/utils/directives.js | 2 +- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/components/preview/SimTextPreview.vue b/src/components/preview/SimTextPreview.vue index b39a2b1..46a8119 100644 --- a/src/components/preview/SimTextPreview.vue +++ b/src/components/preview/SimTextPreview.vue @@ -148,7 +148,7 @@ }, data(){ return{ - lightTheme: true, + lightTheme: false, contentsHide: false, defalutLanguage: 'redis', lineWrapping: false, @@ -281,6 +281,7 @@ // 界面的渲染后的初始化工作 this.$nextTick(()=>{ + this.onDialogDblClick() this.dargDialogSize() this.dragControllerDiv() this.setTheme() @@ -328,6 +329,16 @@ resize.setAttribute('icon-style', 'show') } }, + // 双击header放大缩小 + onDialogDblClick() { + const dialogHeader = document.querySelector('.simtext-dialog .el-dialog__header') + const that = this + dialogHeader.ondblclick = function (e) { + if(e.target && 'simtext-header-title' === e.target.className){ + that.fullScreen() + } + } + }, // 拖动调整窗口大小 dargDialogSize(){ // 右下角 @@ -341,7 +352,6 @@ let editorHieght = that.editorHieght let dialogWidth = that.dialogWidth document.onmousemove = function (e) { - console.log('onmousemove,onmousemove,onmousemove') let endX = e.clientX; let endY = e.clientY; const moveX = endX - startX diff --git a/src/utils/directives.js b/src/utils/directives.js index 28cfb0b..2f602ea 100644 --- a/src/utils/directives.js +++ b/src/utils/directives.js @@ -138,7 +138,7 @@ Vue.directive('dialogDrag', { let x = (document.body.clientWidth - dialogWidth)/2 let y = (document.body.clientHeight - document.body.clientHeight * binding.value.dialogWidthPercent)/2 dragDom.style.transform="translate("+x+"px,"+y+"px)"; - dialogHeaderEl.style.cursor = 'move'; + //dialogHeaderEl.style.cursor = 'move'; // 获取原有属性 ie dom元素.currentStyle 火狐谷歌 window.getComputedStyle(dom元素, null); const sty = dragDom.currentStyle || window.getComputedStyle(dragDom, null); // 鼠标按下事件