1. Home
  2. Vue
  3. V-on:click

Vue on click directive listens for a click event on a given element. You can reference a method to fire on each click. Use v-on:click or a shorthand @click, they work exactly the same way.

<input v-model="newRecord" type="text">
<button v-on:click="addRecord">Add record</button>

    new Vue({
        el: '#app',
        data: {
            newRecord: '',
            records: []
        methods: {
                this.newRecord = "";
Full Vue cheatsheet
Atlas VPN Atlas VPN