Skip to content

Commit f9d8523

Browse files
authored
fix: 🐛 修复textarea统计多码元字符长度错误的问题 (#940)
Closes: #933
1 parent 7478939 commit f9d8523

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/uni_modules/wot-design-uni/components/wd-textarea/wd-textarea.vue

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,11 @@ const isRequired = computed(() => {
177177
178178
// 当前文本域文字长度
179179
const currentLength = computed(() => {
180-
return String(formatValue(props.modelValue) || '').length
180+
/**
181+
* 使用Array.from处理多码元字符以获取正确的长度
182+
* @link https://github.com/Moonofweisheng/wot-design-uni/issues/933
183+
*/
184+
return Array.from(String(formatValue(props.modelValue) || '')).length
181185
})
182186
183187
const rootClass = computed(() => {

0 commit comments

Comments
 (0)