Skip to content

Instantly share code, notes, and snippets.

@mfaridzia
Last active June 5, 2018 11:53
Show Gist options
  • Save mfaridzia/62b2296a22e35da24b6a1f45af771cb2 to your computer and use it in GitHub Desktop.
Save mfaridzia/62b2296a22e35da24b6a1f45af771cb2 to your computer and use it in GitHub Desktop.
// File: ChangeValue.vue
<template>
<div>
{{ datvalue }}
</div>
</template>
<script>
import { EventBus } from '@/eventBus.js'
export default {
data() {
return {
datvalue: 0
}
},
created () {
EventBus.$on('changeValue', (val) => {
this.datvalue = val
console.log('triggered')
})
}
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment