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 do i get attribute of the element or pass element attribute if this is not a handler function #11

Closed lim-enhui closed 5 years ago

lim-enhui commented 6 years ago

how do i work with this??? i need to get the id but the tap doesnt pass args... this is generated in v-for example

circle(v-else :key='key' :r="getNodeSize(node) / 2" v-hammer:pan="onPan" v-hammer:tap="onTap" :id="node.id" :cx="node.x" :cy="node.y" :style='nodeStyle(node)' :title="node.name" :class="nodeClass(node)" :ref="'nodecircle ' + node.id" v-bind='node._svgAttrs' )

pajtai commented 6 years ago

@lim-enhui you can follow:

<div hammer:tap="() => onTap(node.id)">

see: https://github.com/vuejs/vue/issues/5588#issuecomment-299138559