Το v-on ακούει DOM events (κλικ, input, πάτημα πλήκτρου) και εκτελεί έναν handler. Η συντομογραφία του είναι @.
<script setup>
import { ref } from "vue";
const count = ref(0);
function increment() { count.value++; }
</script>
<template>
<button v-on:click="increment">Full syntax</button>
<button @click="increment">Shorthand (idiomatic)</button>
<button @click="count++">Inline expression</button>
<button @click="increment($event, 'extra')">Pass args + the event</button>
</template>
Μπορείς να περάσεις ένα όνομα μεθόδου, μια inline έκφραση ή να καλέσεις μια μέθοδο με παράμετρους. Το native event object είναι διαθέσιμο ως .
