diff --git a/src/js/meditor/index.js b/src/js/meditor/index.js index f820a70..a3c7a7e 100644 --- a/src/js/meditor/index.js +++ b/src/js/meditor/index.js @@ -306,10 +306,12 @@ Anot.component('meditor', { class="editor-body" spellcheck="false" :attr="{disabled: disabled}" + :css="{'padding-bottom': padding}" :duplex="value"> ` @@ -367,6 +369,7 @@ Anot.component('meditor', { if (typeof this.props.created === 'function') { this.props.created(new MEObject(this)) } + this.padding = (this.$elem.clientHeight / 2) >>> 0 this.compile() if (this.preview) { this.htmlTxt = this.__tmp__ @@ -385,6 +388,7 @@ Anot.component('meditor', { } }, state: { + padding: 90, height: 180, disabled: false, //禁用编辑器 fullscreen: false, //是否全屏 diff --git a/src/js/meditor/skin/main.scss b/src/js/meditor/skin/main.scss index 3cfda4b..7f0dcc7 100644 --- a/src/js/meditor/skin/main.scss +++ b/src/js/meditor/skin/main.scss @@ -34,9 +34,9 @@ } } - .editor-body{overflow:hidden;overflow-y:auto;float:left;width:100%;height:100%;padding:5px 5px 50px;line-height:1.5;border:0;outline:none;resize:none;color:nth($cgr, 1);background:#fff;font-size:13px;} + .editor-body{overflow:hidden;overflow-y:auto;float:left;width:100%;height:100%;padding:5px 5px 90px;line-height:1.5;border:0;outline:none;resize:none;color:nth($cgr, 1);background:#fff;font-size:13px;font-family:Menlo,Monaco,Consolas,"Courier New",monospace;} - .md-preview {float:right;overflow:hidden;overflow-y:auto;display:block;width:50%;height:100%;padding:10px 10px 50px;line-height:1.5;border-left:1px solid nth($cp, 2);color:nth($cd, 1);font-size:14px;background:#fff;} + .md-preview {float:right;overflow:hidden;overflow-y:auto;display:block;width:50%;height:100%;padding:10px 10px 90px;line-height:1.5;border-left:1px solid nth($cp, 2);color:nth($cd, 1);font-size:14px;background:#fff;}