<!-- 多行文本输入框 -->
<div class="textareadiv">
<div id="textareadiv" class="textarea placeholder" contenteditable="true" @input="com" >
</div>
<div class="num-mark c-cccccc" style="">{{len}}/500</div>
<div class="textareadiv">
<div id="textareadiv" class="textarea placeholder" contenteditable="true" @input="com" >
</div>
<div class="num-mark c-cccccc" style="">{{len}}/500</div>
</div>
//监听输入的函数
com(){
// console.log("dsds");
var text = document.getElementById("textareadiv").innerText;
if(text.length != 0){
document.getElementById("textareadiv").classList.remove('placeholder');
}
this.len=document.getElementById("textareadiv").innerText.length;
//console.log(document.getElementById("textareadiv").innerText);
}
//实现placeholder
. #textareadiv.placeholder:after{
content: "请输入姓名";
color: #ddd;
}