-
-
Save uno-de-piera/3e81d04fe58dd64542312e17c6018285 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
<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