Is there a way to generate missing nested objects (such as bar
, a
, b
, and c
) when employing Vue.$set
in the following manner?
export const mutations = {
UPDATE(state, payload) {
this._vm.$set(state.foo.bar.a.b.c, payload.key, payload.value)
}
}
Instead of using state.foo.bar.a.b.c
, I'm actually utilizing _.get(state, payload.path)
.