[Vuejs]-How to set nested state in vuex store?

0👍

You can assign state attribute to new object to make it reactive:

updateOptionValue(state, { index, optionIndex, value }) {
  let values = state.formFieldList[index].schema.values;
  let labelName = values[optionIndex].labelName;
  values[optionIndex] = {
    value,
    labelName
  }
  state.formFieldList = JSON.parse(JSON.stringify(state.formFieldList)) // assign new object
}

Leave a comment