优化meditor的编辑器
parent
5d8b44ea67
commit
0c840dbd72
|
@ -306,10 +306,12 @@ Anot.component('meditor', {
|
||||||
class="editor-body"
|
class="editor-body"
|
||||||
spellcheck="false"
|
spellcheck="false"
|
||||||
:attr="{disabled: disabled}"
|
:attr="{disabled: disabled}"
|
||||||
|
:css="{'padding-bottom': padding}"
|
||||||
:duplex="value"></textarea>
|
:duplex="value"></textarea>
|
||||||
<content
|
<content
|
||||||
ref="preview"
|
ref="preview"
|
||||||
class="md-preview do-marked-theme"
|
class="md-preview do-marked-theme"
|
||||||
|
:css="{'padding-bottom': padding}"
|
||||||
:visible="preview"
|
:visible="preview"
|
||||||
:html="htmlTxt"></content>
|
:html="htmlTxt"></content>
|
||||||
`
|
`
|
||||||
|
@ -367,6 +369,7 @@ Anot.component('meditor', {
|
||||||
if (typeof this.props.created === 'function') {
|
if (typeof this.props.created === 'function') {
|
||||||
this.props.created(new MEObject(this))
|
this.props.created(new MEObject(this))
|
||||||
}
|
}
|
||||||
|
this.padding = (this.$elem.clientHeight / 2) >>> 0
|
||||||
this.compile()
|
this.compile()
|
||||||
if (this.preview) {
|
if (this.preview) {
|
||||||
this.htmlTxt = this.__tmp__
|
this.htmlTxt = this.__tmp__
|
||||||
|
@ -385,6 +388,7 @@ Anot.component('meditor', {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
state: {
|
state: {
|
||||||
|
padding: 90,
|
||||||
height: 180,
|
height: 180,
|
||||||
disabled: false, //禁用编辑器
|
disabled: false, //禁用编辑器
|
||||||
fullscreen: false, //是否全屏
|
fullscreen: false, //是否全屏
|
||||||
|
|
|
@ -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;}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Reference in New Issue