fix: InputNumber的onChange的value的类型增加null (#28769)

Co-authored-by: 冷方冰 <lengfangbing@bytedance.com>
This commit is contained in:
冷方冰 2021-01-08 20:15:37 +08:00 committed by GitHub
parent d036e3adfc
commit a4194baa25
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 3 deletions

View File

@ -28,7 +28,7 @@ When a numeric value needs to be provided.
| size | The height of input box | `large` \| `middle` \| `small` | - | - |
| step | The number to which the current value is increased or decreased. It can be an integer or decimal | number \| string | 1 | - |
| value | The current value | number | - | - |
| onChange | The callback triggered when the value is changed | function(value: number \| string) | - | - |
| onChange | The callback triggered when the value is changed | function(value: number \| string \| null) | - | - |
| onPressEnter | The callback function that is triggered when Enter key is pressed | function(e) | - | - |
| onStep | The callback function that is triggered when click up or down buttons | (value: number, info: { offset: number, type: 'up' \| 'down' }) => void | - | 4.7.0 |

View File

@ -20,7 +20,7 @@ export interface InputNumberProps
step?: number | string;
defaultValue?: number;
tabIndex?: number;
onChange?: (value: number | string | undefined) => void;
onChange?: (value: number | string | undefined | null) => void;
disabled?: boolean;
readOnly?: boolean;
size?: SizeType;

View File

@ -31,7 +31,7 @@ cover: https://gw.alipayobjects.com/zos/alicdn/XOS8qZ0kU/InputNumber.svg
| size | 输入框大小 | `large` \| `middle` \| `small` | - | - |
| step | 每次改变步数,可以为小数 | number \| string | 1 | - |
| value | 当前值 | number | - | - |
| onChange | 变化回调 | function(value: number \| string) | - | - |
| onChange | 变化回调 | function(value: number \| string \| null) | - | - |
| onPressEnter | 按下回车的回调 | function(e) | - | - |
| onStep | 点击上下箭头的回调 | (value: number, info: { offset: number, type: 'up' \| 'down' }) => void | - | 4.7.0 |