通过设置 autosize 属性可以使得文本域的高度能够根据文本内容自动进行调整,并且 autosize 还可以设定为一个对象,指定最小行数和最大行数。
关键代码::autosize="{ minRows: 5, maxRows: 5}"
<el-input type="textarea" :maxlength="500" :autosize="{ minRows: 5, maxRows: 5}"></el-input>
通过设置 autosize 属性可以使得文本域的高度能够根据文本内容自动进行调整,并且 autosize 还可以设定为一个对象,指定最小行数和最大行数。
关键代码::autosize="{ minRows: 5, maxRows: 5}"
<el-input type="textarea" :maxlength="500" :autosize="{ minRows: 5, maxRows: 5}"></el-input>