Preventing enter key down on button - Vue

Viewed 62

I only want to fire my button on click events (not on pressing enter), and it works in a dynamic way right now:

<button class="btn btn-primary" type="button" v-on="{ click: isInProgress ? stop : start }">

My question is, how to put the prevent modifier to click this way? I know deleting the type="button" would do the trick too, but I cannot.

So what's the @click.prevent="" - solution for the v-on way? Thanks in advance!

1 Answers

if you want to stop "keydown.enter" from firing the button you can use keydown.enter.prevent

 <button
    class=""
    type="button"
    v-on:keydown.enter.prevent
    v-on="{ click: isInProgress ? stop : start }"
  ></button>
Related