-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Closed
Description
ant-design-vue/components/input/Input.tsx
Lines 286 to 313 in cddaf8c
| const inputProps = { | |
| ...otherProps, | |
| ...attrs, | |
| autocomplete: autocomplete.value, | |
| onChange: handleChange, | |
| onInput: handleChange, | |
| onFocus, | |
| onBlur, | |
| onKeydown: handleKeyDown, | |
| class: classNames( | |
| getInputClassName(prefixCls.value, bordered, size.value, disabled, direction.value), | |
| { | |
| [attrs.class as string]: attrs.class && !addonBefore && !addonAfter, | |
| }, | |
| ), | |
| ref: inputRef, | |
| key: 'ant-input', | |
| size: htmlSize, | |
| id: otherProps.id ?? formItemContext.id.value, | |
| }; | |
| if (valueModifiers.lazy) { | |
| delete inputProps.onInput; | |
| } | |
| if (!inputProps.autofocus) { | |
| delete inputProps.autofocus; | |
| } | |
| const inputNode = <input {...inputProps} />; | |
| return withDirectives(inputNode as VNode, [[antInputDirective]]); |
inputProps.size 如果为0或者undefined等任意 false 值, 传递给 <input {...inputProps} />
会报一个warning
[Vue warn]: Failed setting prop "size" on : value 0 is invalid. DOMException: Failed to set the 'size' property on 'HTMLInputElement': The value provided is 0, which is an invalid size.
建议处理一下,开发起来控制台一大堆 warning, 影响很大。