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); // 鼠标按下事件