v-on listens for DOM events (clicks, input, keypresses) and runs a handler. Its shorthand is @.
<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>
You can pass a method name, an inline expression, or call a method with arguments. The native event object is available as .
