mirror of
https://gitee.com/element-plus/element-plus.git
synced 2024-12-02 19:28:14 +08:00
perf(components): [slider] emit UPDATE_MODEL_EVENT only if value changes (#8603)
This commit is contained in:
parent
9781552a2e
commit
e939850863
@ -251,7 +251,10 @@ export const useSliderButton = (
|
||||
let value =
|
||||
steps * lengthPerStep * (max.value - min.value) * 0.01 + min.value
|
||||
value = Number.parseFloat(value.toFixed(precision.value))
|
||||
emit(UPDATE_MODEL_EVENT, value)
|
||||
|
||||
if (value !== props.modelValue) {
|
||||
emit(UPDATE_MODEL_EVENT, value)
|
||||
}
|
||||
|
||||
if (!initData.dragging && props.modelValue !== initData.oldValue) {
|
||||
initData.oldValue = props.modelValue
|
||||
|
Loading…
Reference in New Issue
Block a user