gothinkster/vue-realworld-example-app

Vuex store modifcations

Open

#17 opened on Jan 25, 2018

View on GitHub
 (1 comment) (4 reactions) (0 assignees)JavaScript (4,037 stars) (1,288 forks)batch import
good first issuetype:enhancementtype:help wanted

Description

Hello,

if I am not mistaken, the store is not used in strict mode and if you would change it to strict, you would have a lot of errors like "don't vuex mutate state outside store". Because you are binding all properties of an object directly to v-model. In my opinion this is not good practice, because mutating outside of store can lead to unexpected behaviour in big applications and so debugging would be hell. I think this should be fixed. Either cloning the object before mutating or set for each properties the setter and getter methods, see: https://vuex.vuejs.org/en/forms.html

If you already know this, you should at least mention that inside documentation.

Cheers,

Marco

Contributor guide