fix Slider组件第一次click的时候不触发on-change

This commit is contained in:
miomio-xiao 2018-04-02 16:47:40 +08:00
parent 1534227581
commit d4c9b17b0f

View file

@ -326,11 +326,12 @@
const index = type === 'min' ? 0 : 1;
if (type === 'min') newPos = this.checkLimits([newPos, this.maxPosition])[0];
else newPos = this.checkLimits([this.minPosition, newPos])[1];
const modulus = this.handleDecimal(newPos,this.step);
const value = this.currentValue;
const value = [...this.currentValue];
value[index] = newPos - modulus;
this.currentValue = [...value];
this.currentValue = value;
if (!this.dragging) {
if (this.currentValue[index] !== this.oldValue[index]) {
this.emitChange();