v-on dëgjon për ngjarje DOM (klika, input, shtypje tastiere) dhe ekzekuton një handler. Shkurtesa e tij është @.
<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>
Mund të kaloni një emër metode, një shprehje inline, ose të thërrisni një metodë me argumente. Objekti i ngjarjes native është i disponueshëm si .
