methods function vue code example
Example: vue methods
<template>
<div id="example">
<button v-on:click="greet">Greet</button>
</div>
</template>
<script>
export default {
methods: {
greet: function(event) {
// `event` is the native DOM event
alert(event.target.tagName);
}
}
};
</script>