Skip to content

Instantly share code, notes, and snippets.

@mfaridzia
Last active June 5, 2018 11:54
Show Gist options
  • Save mfaridzia/e351fd605e9efc4be5ab562d330db636 to your computer and use it in GitHub Desktop.
Save mfaridzia/e351fd605e9efc4be5ab562d330db636 to your computer and use it in GitHub Desktop.
// file: Value.vue
<template>
<div>
<button @click="addValue"> Add Value </button>
</div>
</template>
<script>
import { EventBus } from '@/eventBus.js'
export default {
data() {
return {
value: 0
}
},
methods: {
addValue() {
this.value++
EventBus.$emit('changeValue', this.value)
}
}
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment