Last active
June 5, 2018 11:54
-
-
Save mfaridzia/e351fd605e9efc4be5ab562d330db636 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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