Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Add get/set mapping to store fields. #13

Open
SGarno opened this issue Dec 21, 2018 · 2 comments
Open

Feature: Add get/set mapping to store fields. #13

SGarno opened this issue Dec 21, 2018 · 2 comments

Comments

@SGarno
Copy link

SGarno commented Dec 21, 2018

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. 😃

@akodkod
Copy link
Contributor

akodkod commented Jan 19, 2019

@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
Copy link
Contributor

akodkod commented Aug 29, 2019

#44

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants