In this case it is not necessary and I could have use state.status = status, no worries.
But as I'm more concerned with (vuejs.org/v2/guide/reactivity.html) I've got used to always write Vue.set to avoid any pitfalls while developing. So it is just a way to keep the codebase concise (in one mutation it is state.prop = prop and in the other is Vue.set...).
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Why you use Vue.set(state, 'status', status) instead of just state.status = status?
In this case it is not necessary and I could have use
state.status = status
, no worries.But as I'm more concerned with (vuejs.org/v2/guide/reactivity.html) I've got used to always write
Vue.set
to avoid any pitfalls while developing. So it is just a way to keep the codebase concise (in one mutation it isstate.prop = prop
and in the other isVue.set...
).