fix Slider组件第一次click的时候不触发on-change
This commit is contained in:
parent
1534227581
commit
d4c9b17b0f
1 changed files with 4 additions and 3 deletions
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue