div contenteditable="true" 添加placehoder效果
<div class="contain" :style="{height: editableHeight + 'px'}"
v-html="innerText"
ref="editableDiv"
contenteditable="true"
:placeholder=placeholder
@input="inputText"
@blur="inputBlur"
@focus="inputFocus">
.contain {
width: 100%;
padding: 3px;
border: 1px solid #DCDFE6;
border-radius:4px;
font-size: 12px;
overflow-x: hidden;
overflow-y: auto;
}
.contain:empty::before {
content: attr(placeholder);
color: grey;
}
此随笔或为自己所写、或为转载于网络。仅用于个人收集及备忘。