mirror of
https://gitee.com/element-plus/element-plus.git
synced 2024-12-04 20:27:44 +08:00
fix(components): [input-number] increase and decrease error (#10067)
fix(components): [input-number] increase and decrease error (#10063)
This commit is contained in:
parent
b3be81dc50
commit
a8c6df5958
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user