Skip to content

Instantly share code, notes, and snippets.

@uno-de-piera
Last active May 1, 2019 11:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save uno-de-piera/3e81d04fe58dd64542312e17c6018285 to your computer and use it in GitHub Desktop.
Save uno-de-piera/3e81d04fe58dd64542312e17c6018285 to your computer and use it in GitHub Desktop.
<template>
<div>
<input name="name" v-model="name" />
<input name="surname" v-model="surname" />
<input name="email" v-model="email" />
<input name="age" v-model="age" />
<input name="address" v-model="address" />
</div>
</template>
<script>
export default {
computed: {
name: {
get () {
return this.$store.state.name
},
set (val) {
this.$store.commit('setName', val)
}
},
surname: {
get () {
return this.$store.state.surname
},
set (val) {
this.$store.commit('setSurname', val)
}
},
email: {
get () {
return this.$store.state.email
},
set (val) {
this.$store.commit('setEmail', val)
}
},
age: {
get () {
return this.$store.state.age
},
set (val) {
this.$store.commit('setAge', val)
}
},
address: {
get () {
return this.$store.state.address
},
set (val) {
this.$store.commit('setAddress', val)
}
}
}
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment