fix(components): [input-number] Improve modelValue prop type (#16124)

* fix(components): [input-number] Improve modelValue prop type

* Update packages/components/input-number/src/input-number.ts

Co-authored-by: kooriookami <38392315+kooriookami@users.noreply.github.com>

---------

Co-authored-by: kooriookami <38392315+kooriookami@users.noreply.github.com>
This commit is contained in:
忆白°
2025-05-20 17:29:46 +08:00
committed by GitHub
parent c64d00b1af
commit ca533d18f9
2 changed files with 4 additions and 2 deletions

View File

@@ -101,7 +101,7 @@ input-number/with-prefix-suffix
| Name | Description | Type | Default |
| --------------------------- | ------------------------------------------------ | --------------------------------------------- | --------- |
| model-value / v-model | binding value | ^[number] | — |
| model-value / v-model | binding value | ^[number] / ^[null] | — |
| min | the minimum allowed value | ^[number] | -Infinity |
| max | the maximum allowed value | ^[number] | Infinity |
| step | incremental step | ^[number] | 1 |

View File

@@ -45,7 +45,9 @@ export const inputNumberProps = buildProps({
/**
* @description binding value
*/
modelValue: Number,
modelValue: {
type: [Number, null],
},
/**
* @description same as `readonly` in native input
*/