File tree Expand file tree Collapse file tree
src/uni_modules/wot-design-uni/components/wd-textarea Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -181,7 +181,7 @@ const currentLength = computed(() => {
181181 * 使用Array.from处理多码元字符以获取正确的长度
182182 * @link https://github.com/Moonofweisheng/wot-design-uni/issues/933
183183 */
184- return Array .from (String (formatValue (props .modelValue ) || ' ' )).length
184+ return Array .from (String (formatValue (props .modelValue ))).length
185185})
186186
187187const rootClass = computed (() => {
@@ -224,6 +224,7 @@ function initState() {
224224}
225225
226226function formatValue(value : string | number ) {
227+ if (value === null || value === undefined ) return ' '
227228 const { maxlength, showWordLimit } = props
228229 if (showWordLimit && maxlength !== - 1 && String (value ).length > maxlength ) {
229230 return value .toString ().substring (0 , maxlength )
You can’t perform that action at this time.
0 commit comments