mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
[bugfix] Slider: fix slider drag and value
props change at the same time can not drag success (#3206)
This commit is contained in:
parent
2190b34028
commit
38820373bc
@ -48,12 +48,13 @@ export default sfc({
|
|||||||
const total = this.vertical ? rect.height : rect.width;
|
const total = this.vertical ? rect.height : rect.width;
|
||||||
const diff = (delta / total) * 100;
|
const diff = (delta / total) * 100;
|
||||||
|
|
||||||
this.updateValue(this.startValue + diff);
|
this.newValue = this.startValue + diff;
|
||||||
|
this.updateValue(this.newValue);
|
||||||
},
|
},
|
||||||
|
|
||||||
onTouchEnd() {
|
onTouchEnd() {
|
||||||
if (this.disabled) return;
|
if (this.disabled) return;
|
||||||
this.updateValue(this.value, true);
|
this.updateValue(this.newValue, true);
|
||||||
},
|
},
|
||||||
|
|
||||||
onClick(event) {
|
onClick(event) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user