Skip to content

Instantly share code, notes, and snippets.

@shailen-naidoo
Created December 13, 2018 05:38
Show Gist options
  • Save shailen-naidoo/d924d27274e0532985b2d1639c1640cc to your computer and use it in GitHub Desktop.
Save shailen-naidoo/d924d27274e0532985b2d1639c1640cc to your computer and use it in GitHub Desktop.
Vue events
<template>
<button v-on:click="clicked()">
counter
</button>
</template>
<script>
export default {
data() {
return {
count: 0
}
},
methods: {
clicked() {
this.count++;
this.$emit("clicked",this.count);
}
}
}
</script>
<style>
</style>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment