Skip to content

Instantly share code, notes, and snippets.

@uno-de-piera
Created May 1, 2019 11:41
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/aa401f46fdb3173424da32853dda8ceb to your computer and use it in GitHub Desktop.
Save uno-de-piera/aa401f46fdb3173424da32853dda8ceb 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>
import {computedPropertiesGenerator} from "../computedPropertiesGenerator";
export default {
computed: {
...computedPropertiesGenerator([
{property: 'name', defaultValue: ''},
{property: 'surname', defaultValue: ''},
{property: 'email', defaultValue: ''},
{property: 'age', defaultValue: 18},
{property: 'address', defaultValue: null},
], {pathStore: 'user', mutation: 'setPropertyOnUser'}),
}
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment