Skip to content

Instantly share code, notes, and snippets.

@aqidd
Last active April 26, 2017 06:20
Show Gist options
  • Save aqidd/e944860513519988d412979bc847bf91 to your computer and use it in GitHub Desktop.
Save aqidd/e944860513519988d412979bc847bf91 to your computer and use it in GitHub Desktop.
<template>
<input v-model="message">
</template>
<script>
import { mapMutations } from 'vuex'
export default {
computed: {
message: {
get () {
return this.$store.state.message
},
set (val) {
this.updateMessage({path: 'entry.message', value: val})
}
}
},
methods: {
...mapMutations({
updateMessage: 'UPDATE_MESSAGE'
})
}
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment