vue+element文本域设置自适应和默认高度

<el-form-item label="私密" :label-width="'140px'" prop="private_key">

<el-input

size="small"

v-model="form.private_key"

placeholder="请填写"

type="textarea"

:autosize="{ minRows: 2, maxRows: 4}"

></el-input>

</el-form-item>

通过设置 autosize 属性可以使得文本域的高度能够根据文本内容自动进行调整,并且 autosize 还可以设定为一个对象,指定最小行数和最大行数。

猜你喜欢

转载自blog.csdn.net/yyongsheng/article/details/127526014