6 months ago

Double click and single click on same element in Vue.js

Posted 6 months ago by admirhusic

I want to implement something like instagram does on photos. When the user clicks on the photo the app opens the current post, but when the user double clicks on the photo it triggers a like.

    <a :href="'p/'+" >
          <img class="card-img-top w-100"  :src="post.image_path" />

if I do it like this

   <a @dblclick="likeThePost("  :href="'p/'+" >
          <img class="card-img-top w-100" :src="post.image_path" />

it opens the post and triggers the like in the same time

Please sign in or create an account to participate in this conversation.