bsdfzzzy / vue2-hammer

Hammer.js wrapper for Vue 2.x to support some touching operation in the mobile.
MIT License
253 stars 48 forks source link

How to pass arguments? #24

Open gonnavis opened 5 years ago

gonnavis commented 5 years ago

For example, v-hammer:tap="add(item, i)" now is not working.

gonnavis commented 5 years ago

I find the solution v-hammer:tap="function(){ add(item, i) }", but a little ugly.

lb01910483 commented 5 years ago

you can use v-hammer:tap="() => testFunction(arg)" if you want to original event you can pass like

(originalevent) => testFunction(originalevent, args)

maybe more elegant