feat(Picker): improve scroll speed (#5951)

This commit is contained in:
neverland 2020-03-30 19:20:02 +08:00 committed by GitHub
parent 2dc029f20b
commit d0132f23f3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -236,7 +236,7 @@ export default createComponent({
momentum(distance, duration) { momentum(distance, duration) {
const speed = Math.abs(distance / duration); const speed = Math.abs(distance / duration);
distance = this.offset + (speed / 0.002) * (distance < 0 ? -1 : 1); distance = this.offset + (speed / 0.003) * (distance < 0 ? -1 : 1);
const index = this.getIndexByOffset(distance); const index = this.getIndexByOffset(distance);