Binding problem between v-model in vue and store in vuex

there is an object in the data of the vue component. The properties in the object are bound with v-model, and then submit the data object with vuex"s commit, which will result in changing the value of the form to affect the data in store. What if you don"t copy this object?

Jun.14,2022

commit is a responsive data that needs to be dealt with by JSON.parse (JSON.stringify (data))


since it is a form operation, generally speaking, you only need shallow copy, {... obj}, you already know the reason, why not copy it?

Menu