robinrodricks / vue3-touch-events

Simple touch events support for vue.js 3
MIT License
216 stars 27 forks source link

Why does the plugin, when initializing the page, execute all events hung on each element of the list #16

Open Shirockov55 opened 1 year ago

Shirockov55 commented 1 year ago

Why does the plugin, when initializing the page, execute all events hung on each element of the list, while nothing should happen to these elements at all. And when a new element appears, these events fire again on it. <div v-touch:tap="takeOrder(order)" class="orderCard-wrap">...</div> i use: vite 2.6.4 vue3-touch-events 4.1.0

KEYHAN-A commented 1 year ago

I have the same problem, <p-swipe-list v-for="(item, id) in items" :key="id" v-touch:swipe.left="test('left')" v-touch:swipe.right="test('right')" />

all swipe events gets fired on mount

interactivesites commented 1 year ago

Same here. This is caused by using the brackets (), e.g. takeOrder(param). This has something to do with the template rendering in vue - which I don't have specifics on yet. Try this: <div v-touch:tap="()=>takeOrder(order)" class="orderCard-wrap">...</div>

noremacsim commented 1 year ago

This doesn't work, if we have a tap, and a Hold method for example the tab is calling the defined method when a user hold/longpress a button