gothinkster/vue-realworld-example-app

Vuex store modifcations

Open

#17 geöffnet am 25. Jan. 2018

Auf GitHub ansehen
 (1 Kommentar) (4 Reaktionen) (0 zugewiesene Personen)JavaScript (4.037 Stars) (1.288 Forks)batch import
good first issuetype:enhancementtype:help wanted

Beschreibung

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