vueuse / gesture

🕹 Vue Composables making your app interactive

Home Page:https://gesture.vueuse.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

nice, but how to disabled spring effects

aizigao opened this issue · comments

spring effect is pretty good, however, sometime I don't need it, so how to disabled it?

Hello 😄,

If you want your gestures to be "instantaneous", you can bind them directly to your element's style properties!

const element = ref<HTMLElement>()

// Drag handler
const handler = ({ movement: [x, y] }) => {
  // Check element existence
  if (!element.value) return

  // Apply movement values
  element.value.style.transform = `translate3d(${x}, ${y}, 0`
}