vuex-electron icon indicating copy to clipboard operation
vuex-electron copied to clipboard

Feature: Add get/set mapping to store fields.

Open SGarno opened this issue 5 years ago • 2 comments

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 avatar Dec 21 '18 06:12 SGarno

@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 😉

akodkod avatar Jan 19 '19 20:01 akodkod

https://github.com/vue-electron/vuex-electron/issues/44

akodkod avatar Aug 29 '19 14:08 akodkod