textarea 自动检测高度换行
let dom = document.getElementById(id);
dom.addEventListener('input',function () {
dom.style.height = dom.scrollTop + dom.scrollHeight + 'px';
});
dom.addEventListener('propertychange',function () { //兼容IE
dom.style.height = dom.scrollTop + dom.scrollHeight + 'px';
}
// 传id
function autoHeight(id){
}
先这么用着,还需要进一步优化。