How to handle events in Vue js

In this article,we will understand about calling events inside vuejs. The event calling is one of the important concept in any programming language. The normal events are click events,change events etc.

Handling events in Vuejs:

The event handling in Vuejs can be explained clearly by the following example.
Scenario: Let us take this example,on click of button we need to display the name.

<html>
<head>
<title>
<script type=text/javascript src=js/vue.js><script>
<head>
<body>
<div id=dvevents>

<button v-on:click="displayname">< Display Me br>
<button><br>
<h2>{{Name}}<h2>
<div>
<script type=text/javascript>
var vm=new vue({
    el:'#dvevents',
    data: {	
	 Name:'Muruga'
	},
    methods:{
              DisplayMe:function(event){
                  return this.Name;
                }
    },
    computed:{
    },   
  });
<script>
<body>
<html>

In the above example, we have on 'DisplayMe' button, the user clicks here to see his name.When user clicks button it calls 'DisplayMe' function there it will return the name given in the data section.

Happy Vue Coding !!!