From 8ce0f03024ba9ad4f2ce7920143a2de7e7c9f45a Mon Sep 17 00:00:00 2001 From: ZTrainWilliams <30279504+ZTrainWilliams@users.noreply.github.com> Date: Tue, 19 Mar 2024 14:27:53 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=AE=89=E5=8D=93?= =?UTF-8?q?=E5=BE=AE=E4=BF=A1=E5=AE=9E=E9=99=85=E8=BE=93=E5=85=A5=E5=AD=97?= =?UTF-8?q?=E6=95=B0=E8=B6=85=E8=BF=87=E9=99=90=E5=88=B6=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- uni_modules/uview-ui/components/u-textarea/u-textarea.vue | 3 +++ 1 file changed, 3 insertions(+) diff --git a/uni_modules/uview-ui/components/u-textarea/u-textarea.vue b/uni_modules/uview-ui/components/u-textarea/u-textarea.vue index 2cd5fdc3..6835c516 100644 --- a/uni_modules/uview-ui/components/u-textarea/u-textarea.vue +++ b/uni_modules/uview-ui/components/u-textarea/u-textarea.vue @@ -164,6 +164,9 @@ export default { }, onInput(e) { let { value = "" } = e.detail || {}; + if (this.maxlength > 0 && value.length > this.maxlength) { + value = value.subtring(0, this.maxlength); + } // 格式化过滤方法 const formatter = this.formatter || this.innerFormatter const formatValue = formatter(value)