Skip to content

Commit df6a6a0

Browse files
fix: 🐛 修复Input设置为number类型时绑定值重设为0时显示异常的问题
Closes: #470
1 parent f207876 commit df6a6a0

File tree

1 file changed

+1
-5
lines changed
  • src/uni_modules/wot-design-uni/components/wd-input

1 file changed

+1
-5
lines changed

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

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -126,11 +126,7 @@ watch(
126126
watch(
127127
() => props.modelValue,
128128
(newValue) => {
129-
if (newValue === undefined) {
130-
newValue = ''
131-
console.warn('[wot-design] warning(wd-input): value can not be undefined.')
132-
}
133-
inputValue.value = newValue
129+
inputValue.value = isDef(newValue) ? String(newValue) : ''
134130
},
135131
{ immediate: true, deep: true }
136132
)

0 commit comments

Comments
 (0)