@keyup.enter vue
snippet in html

@keyup.enter vue

user4961

<input v-on:keyup.enter="submit">
<!-- Also works like this: -->
<input @keyup.enter="submit">

vue js button click

user1608

<div id="example-2">
  <!-- `greet` is the name of a method defined below -->
  <button v-on:click="greet">Greet</button>
</div>