<div ref="myRef"
v-html="xssFilter(text.content)"
class="publish_content"
id="publish_content"
contenteditable="true"
:placeholder="placeholder"
@input="contentChange"
></div>
// 输入框获取光标 placehodlder消失
/*为空时显示 element attribute content*/
.publish_content:empty:before{
content: attr(placeholder); /* element attribute*/
/*content: 'this is content';*/
color: #C0C4CC;
}
// 注释掉这个输入框输入值后placehodler消失
/*焦点时内容为空*/
.publish_content:focus:before{
content:none;
}
网友评论