Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to destroy an event? #8

Open
Billionerd opened this issue Nov 21, 2020 · 1 comment
Open

How to destroy an event? #8

Billionerd opened this issue Nov 21, 2020 · 1 comment

Comments

@Billionerd
Copy link

Billionerd commented Nov 21, 2020

I couldn't find any hints in the document. It'd be great if you can show me how to do it.
Thanks !

@wensiyuanseven
Copy link
Owner

// in vue 
methods: {
   pressMove(event) {
       // remove tap event
       event.gesture.off('tap')
    }
  // the tap event no longer takes effect after the removal is triggered
   tap(){
    conso.log('tap')
   }
}

//--------------------------------------------------------------------------------------

// in javascript
let  betterGesture= new BetterGesture(document.getElementById('app'), {
       pressMove(event) {
           console.log(event.deltaX)
       }
   })
   // remove
 betterGesture.off('pressMove')

In fact, it is mentioned in the document, and I guess that the document failed to load, causing you to not find this api. Because it is deployed on git-page, sometimes it fails to load due to some problems (network, operator, region), you can try to switch the network or device to see if the document can be loaded.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants