From 32ad0030eb6bb0196e921488b37113ff3e13a49e Mon Sep 17 00:00:00 2001 From: zw Date: Thu, 7 Aug 2025 14:53:28 +0800 Subject: [PATCH] =?UTF-8?q?fix(textarea):=E5=A2=9E=E5=8A=A0=E6=96=87?= =?UTF-8?q?=E6=9C=AC=E6=AC=BE=E4=B8=ADrows=E7=9A=84=E7=9B=91=E5=90=AC?= =?UTF-8?q?=EF=BC=8C=E5=8A=A8=E6=80=81=E8=B0=83=E6=95=B4=E9=AB=98=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/component/component/textarea/index.vue | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/packages/component/component/textarea/index.vue b/packages/component/component/textarea/index.vue index 1ab6d95d..6c3727a0 100644 --- a/packages/component/component/textarea/index.vue +++ b/packages/component/component/textarea/index.vue @@ -128,7 +128,16 @@ watch( } ); -const onFocus = function (eventParam: Event) { +watch( + () => props.rows, + (value) => { + if (value) { + styles.value.height = `${_CalcLineHeight(props.rows)}px`; + styles.value.maxHeight = `${_CalcLineHeight(props.rows)}px`; + } + }, +); +function onFocus(eventParam: Event) { emit("focus", eventParam); }; -- Gitee