gothinkster/vue-realworld-example-app

Vuex store modifcations

Open

#17 aperta il 25 gen 2018

Vedi su GitHub
 (1 commento) (4 reazioni) (0 assegnatari)JavaScript (1288 fork)batch import
good first issuetype:enhancementtype:help wanted

Metriche repository

Star
 (4037 star)
Metriche merge PR
 (Nessuna PR mergiata in 30 g)

Descrizione

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

Guida contributor