watch: {
textAreaHeight(val, olval) {
// 绑定的data
if (val.length > olval.length) {
let h = this.$refs.textArea.scrollHeight;
this.$refs.textArea.style.height = h + "px";
} else if (val.length == 0) {
this.$refs.textArea.style.height = "0.64rem";
}
}
}
输入框自动适应
最新推荐文章于 2024-06-13 09:47:13 发布