v-on DOM ਇਵੈਂਟਾਂ (ਕਲਿੱਕ, ਇਨਪੁਟ, ਕੀ ਦਬਾਉਣਾ) ਨੂੰ ਸੁਣਦਾ ਹੈ ਅਤੇ ਇੱਕ ਹ ੈਂਡਲਰ ਚਲਾਉਂਦਾ ਹੈ। ਇਸਦਾ ਸ਼ਾਰਟਹੈਂਡ @ ਹੈ।
<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>
ਤੁਸੀਂ ਇੱਕ ਮੈਥਡ ਨਾਮ, ਇੱਕ ਇਨਲਾਈਨ ਐਕਸਪ੍ਰੈਸ਼ਨ, ਜਾਂ ਆਰਗੂਮੈਂਟਾਂ ਦੇ ਨਾਲ ਇੱਕ ਮੈਥਡ ਕਾਲ ਕਰ ਸਕਦੇ ਹੋ। ਨੇਟਿਵ ਇਵੈਂਟ ਆਬਜੈਕਟ ਦੇ ਤੌਰ ਤੇ ਉਪਲਬਧ ਹੈ।
