textarea高度自动改变

直接上代码

<textarea placeholder="手动输入" @keyup="autoHeight($event)"></textarea>
autoHeight:function(event){
                var txtarea=event.target;
                txtarea.style.height='auto';
                txtarea.style.height=txtarea.scrollHeight+"px";
            }

经测试好用

原文地址:https://www.cnblogs.com/wsz168/p/8528497.html