Skip to content

Commit

Permalink
fix(components): [input-number] increase and decrease error (#10067)
Browse files Browse the repository at this point in the history
fix(components): [input-number]  increase and decrease error (#10063)
  • Loading branch information
gjfei committed Oct 27, 2022
1 parent b3be81d commit a8c6df5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/components/input-number/src/input-number.vue
Expand Up @@ -182,14 +182,14 @@ const ensurePrecision = (val: number, coefficient: 1 | -1 = 1) => {
}
const increase = () => {
if (props.readonly || inputNumberDisabled.value || maxDisabled.value) return
const value = props.modelValue || 0
const value = Number(displayValue.value) || 0
const newVal = ensurePrecision(value)
setCurrentValue(newVal)
emit(INPUT_EVENT, data.currentValue)
}
const decrease = () => {
if (props.readonly || inputNumberDisabled.value || minDisabled.value) return
const value = props.modelValue || 0
const value = Number(displayValue.value) || 0
const newVal = ensurePrecision(value, -1)
setCurrentValue(newVal)
emit(INPUT_EVENT, data.currentValue)
Expand Down

0 comments on commit a8c6df5

Please sign in to comment.