今天学习了text area实现输入框随着文字的输入增长
<%@ page contentType="text/html;charset=UTF-8" language="java" %> <html> <head> <title>学生作业提交页面</title> <style type="text/css"> .txt{ border: none; outline: none; font-size: 16px; display: block; width: 100%; resize: none; line-height: 2; background: inherit; } </style> <template> <textarea @input="handleChange" class="txt" rows="1"></textarea> </template> <script> function handleChange(e) { const textarea=e.target(); textarea.style.height=textarea.scrollHeight+'px'; } </script> </head> <body> <textarea class="txt" placeholder="回复内容"></textarea> </body> </html>
标签:总结,none,textarea,31,height,2023.3 From: https://www.cnblogs.com/wllovelmbforever/p/17277373.html