Vue Click Event Element Example




Hi Guys,

Today, I will learn you how to use on click event element in vue. we will show basic example of vue on click event element. you can easily use vue on click event element. We can use the v-on directive to listen to DOM events and run some JavaScript when they’re triggered. v-on is the attribute added to the DOM elements to listen to the events in VueJS.

Here, I will give you full example for vue click event element as bellow.


<!DOCTYPE html>



<title>Vue Click Event Element Example -</title>

<script src=""></script>



<div id="example-1">

<h2>Vue Click Event Element Example</h2>

<button v-on:click="counter += 1">Add 1</button>

<p>The button above has been clicked {{ counter }} times.</p>



<script type="text/javascript">

var example1 = new Vue({

el: '#example-1',

data: {

counter: 0





It will help you...