mirror of
https://github.com/element-plus/element-plus.git
synced 2026-03-13 07:51:17 +08:00
feat(components): [input-number] change the min and max default value (#21302)
* feat(components): [input-number] change the min and max default value * docs: update
This commit is contained in:
@@ -99,27 +99,27 @@ input-number/with-prefix-suffix
|
||||
|
||||
### Attributes
|
||||
|
||||
| Name | Description | Type | Default |
|
||||
| --------------------------- | ------------------------------------------------ | --------------------------------------------- | --------- |
|
||||
| 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 |
|
||||
| step-strictly | whether input value can only be multiple of step | ^[boolean] | false |
|
||||
| precision | precision of input value | ^[number] | — |
|
||||
| size | size of the component | ^[enum]`'large' \| 'default' \| 'small'` | default |
|
||||
| readonly ^(2.2.16) | same as `readonly` in native input | ^[boolean] | false |
|
||||
| disabled | whether the component is disabled | ^[boolean] | false |
|
||||
| controls | whether to enable the control buttons | ^[boolean] | true |
|
||||
| controls-position | position of the control buttons | ^[enum]`'' \| 'right'` | — |
|
||||
| name | same as `name` in native input | ^[string] | — |
|
||||
| aria-label ^(a11y) ^(2.7.2) | same as `aria-label` in native input | ^[string] | — |
|
||||
| placeholder | same as `placeholder` in native input | ^[string] | — |
|
||||
| id | same as `id` in native input | ^[string] | — |
|
||||
| value-on-clear ^(2.2.0) | value should be set when input box is cleared | ^[number] / ^[null] / ^[enum]`'min' \| 'max'` | — |
|
||||
| validate-event | whether to trigger form validation | ^[boolean] | true |
|
||||
| label ^(a11y) ^(deprecated) | same as `aria-label` in native input | ^[string] | — |
|
||||
| inputmode ^(2.10.3) | same as `inputmode` in native input | ^[string] | — |
|
||||
| Name | Description | Type | Default |
|
||||
| --------------------------- | ------------------------------------------------ | --------------------------------------------- | ----------------------- |
|
||||
| model-value / v-model | binding value | ^[number] / ^[null] | — |
|
||||
| min | the minimum allowed value | ^[number] | Number.MAX_SAFE_INTEGER |
|
||||
| max | the maximum allowed value | ^[number] | Number.MIN_SAFE_INTEGER |
|
||||
| step | incremental step | ^[number] | 1 |
|
||||
| step-strictly | whether input value can only be multiple of step | ^[boolean] | false |
|
||||
| precision | precision of input value | ^[number] | — |
|
||||
| size | size of the component | ^[enum]`'large' \| 'default' \| 'small'` | default |
|
||||
| readonly ^(2.2.16) | same as `readonly` in native input | ^[boolean] | false |
|
||||
| disabled | whether the component is disabled | ^[boolean] | false |
|
||||
| controls | whether to enable the control buttons | ^[boolean] | true |
|
||||
| controls-position | position of the control buttons | ^[enum]`'' \| 'right'` | — |
|
||||
| name | same as `name` in native input | ^[string] | — |
|
||||
| aria-label ^(a11y) ^(2.7.2) | same as `aria-label` in native input | ^[string] | — |
|
||||
| placeholder | same as `placeholder` in native input | ^[string] | — |
|
||||
| id | same as `id` in native input | ^[string] | — |
|
||||
| value-on-clear ^(2.2.0) | value should be set when input box is cleared | ^[number] / ^[null] / ^[enum]`'min' \| 'max'` | — |
|
||||
| validate-event | whether to trigger form validation | ^[boolean] | true |
|
||||
| label ^(a11y) ^(deprecated) | same as `aria-label` in native input | ^[string] | — |
|
||||
| inputmode ^(2.10.3) | same as `inputmode` in native input | ^[string] | — |
|
||||
|
||||
### Slots
|
||||
|
||||
|
||||
@@ -38,14 +38,14 @@ export const inputNumberProps = buildProps({
|
||||
*/
|
||||
max: {
|
||||
type: Number,
|
||||
default: Number.POSITIVE_INFINITY,
|
||||
default: Number.MAX_SAFE_INTEGER,
|
||||
},
|
||||
/**
|
||||
* @description the minimum allowed value
|
||||
*/
|
||||
min: {
|
||||
type: Number,
|
||||
default: Number.NEGATIVE_INFINITY,
|
||||
default: Number.MIN_SAFE_INTEGER,
|
||||
},
|
||||
/**
|
||||
* @description binding value
|
||||
|
||||
Reference in New Issue
Block a user