v-on は DOM イベント (クリック、入力、キープレス) をリッスンし、ハンドラーを実行します。短縮形は @ です。
vue
<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>
メソッド名、インライン式、または引数付きメソッド呼び出しを渡すことができます。ネイティブイベントオブジェクトは として利用可能です。
