vuejs / v2.vuejs.org

📄 Documentation for Vue 2
https://v2.vuejs.org
MIT License
5.03k stars 3.43k forks source link

Cookbook: Best practices to handle forms with vuex #1506

Open LinusBorg opened 6 years ago

LinusBorg commented 6 years ago

The Vuex docs have a short section about it, but the suggested pattern is very basic and becomes very verbose in bigger forms.

We also get a lot if questions about this on the forums - how to use v-model with an object from the store without migrating it etc.

There are a couple of different patterns people can apply, and short snippets that can help to remove boilerplate.

I want to do a small talk about this in a meetup in my area at the end of April and would try and translate the content into a cookbook recipe afterwards.

sdras commented 6 years ago

This sounds great! I love it. Would you also be up for updating it when the new version of Vuex is released? Because it sounds like it will break this recipe. It might be worth coordinating (or just getting it in and knowing we'd have to update).

LinusBorg commented 6 years ago

Sure. I think the changes for this recipe will be small, since the main upcoming change in vuex - dropping mutations - doesn't change the patterns as far as I can tell.

sdras commented 6 years ago

Then extra great. 🎸

lucasgsantiago commented 5 years ago

where I can find the conclusion about this topic?