v-on poslušalec za DOM dogodke (kliki, vnos, pritisk tipk) in zažene obdelovalnik. Njegova okrajšava je @.
<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>
Posredujete lahko ime metode, inlinski izraz ali pokličete metodo z argumenti. Izvirni predmet dogodka je na voljo kot .
