Skip to content

Commit cc9a69b

Browse files
committed
修复input无法输入
1 parent bbe04d3 commit cc9a69b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/input/src/index.vue

+2-2
Original file line numberDiff line numberDiff line change
@@ -371,8 +371,8 @@
371371
// hack for https://github.com/ElemeFE/element/issues/8548
372372
// should remove the following line when we don't support IE
373373
if (value === nativeInputValue.value) return
374-
const isNumber = (attrs.modelModifiers as anyObject)?.number
375-
const finalValue = value ? isNumber ? isNaN(parseFloat(value)) ? '' : parseFloat(value) : '' : ''
374+
const isNumber = !!(attrs.modelModifiers as anyObject)?.number
375+
const finalValue = isNumber ? isNaN(parseFloat(value)) ? '' : parseFloat(value) : value
376376
emit('update:modelValue', finalValue)
377377
emit('input', finalValue)
378378
// ensure native input value is controlled

0 commit comments

Comments
 (0)