vuex-electron
vuex-electron copied to clipboard
Feature: Add get/set mapping to store fields.
One of the missing capabilities of Vuex is the ability to do two-way v-model binding directly from the store object (you have to write your own setter and getter for each store object). If your form is extensive, that is a lot of unnecessary coding.
One solution I use in standard (non-electron) vue applications is vuex-map-fields. It allows you to bind to a store field directly with v-model when you just need a simple set/get.
Your computed v-model-friendly property becomes:
computed: {
...mapFields([
'firstName',
'lastName',
'email',
'phone',
'address1',
'address2',
'city',
'state',
'zipcode'
]),
It would be VERY handy to have this same capability (using dispatch) built into vuex-electron. :smiley:
@SGarno it's an excellent suggestion, but unfortunately, I don't have enough time to implement this at the moment. But feel free to open a pull request with such functionality, I would be happy to merge it 😉
https://github.com/vue-electron/vuex-electron/issues/44