From f9d85232c4142f0c957fa3c829dd3321c7ad56e5 Mon Sep 17 00:00:00 2001 From: QingHuan <53939074+RJQingHuan@users.noreply.github.com> Date: Fri, 14 Mar 2025 16:43:38 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=F0=9F=90=9B=20=E4=BF=AE=E5=A4=8Dtextare?= =?UTF-8?q?a=E7=BB=9F=E8=AE=A1=E5=A4=9A=E7=A0=81=E5=85=83=E5=AD=97?= =?UTF-8?q?=E7=AC=A6=E9=95=BF=E5=BA=A6=E9=94=99=E8=AF=AF=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98=20(#940)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ✅ Closes: #933 --- .../wot-design-uni/components/wd-textarea/wd-textarea.vue | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/uni_modules/wot-design-uni/components/wd-textarea/wd-textarea.vue b/src/uni_modules/wot-design-uni/components/wd-textarea/wd-textarea.vue index cf28c227..3c4307ce 100644 --- a/src/uni_modules/wot-design-uni/components/wd-textarea/wd-textarea.vue +++ b/src/uni_modules/wot-design-uni/components/wd-textarea/wd-textarea.vue @@ -177,7 +177,11 @@ const isRequired = computed(() => { // 当前文本域文字长度 const currentLength = computed(() => { - return String(formatValue(props.modelValue) || '').length + /** + * 使用Array.from处理多码元字符以获取正确的长度 + * @link https://github.com/Moonofweisheng/wot-design-uni/issues/933 + */ + return Array.from(String(formatValue(props.modelValue) || '')).length }) const rootClass = computed(() => {