[bugfix] Slider: fix slider drag and value props change at the same time can not drag success (#3206)

This commit is contained in:
张敏 2019-04-24 14:05:02 +08:00 committed by neverland
parent 2190b34028
commit 38820373bc

View File

@ -48,12 +48,13 @@ export default sfc({
const total = this.vertical ? rect.height : rect.width;
const diff = (delta / total) * 100;
this.updateValue(this.startValue + diff);
this.newValue = this.startValue + diff;
this.updateValue(this.newValue);
},
onTouchEnd() {
if (this.disabled) return;
this.updateValue(this.value, true);
this.updateValue(this.newValue, true);
},
onClick(event) {