Skip to content

Instantly share code, notes, and snippets.

@ederchrono
Created May 15, 2019 06:44
Show Gist options
  • Save ederchrono/5d2543a679948aadaa2cd4dabe76bc29 to your computer and use it in GitHub Desktop.
Save ederchrono/5d2543a679948aadaa2cd4dabe76bc29 to your computer and use it in GitHub Desktop.
// inside computed
currentImagePosition () {
if(!this.dragging || this.swipingLeft) {
return 0
}
const position = this.diffX * -DRAGGING_SPEED
return clampPosition(position)
},
currentImageStyle () {
return {
'left': `${this.currentImagePosition}px`
}
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment