[Vuejs]-Unwanted Vuex store state mutation triggered

0👍

They still point to a same reference, which is known as shallow copy. You can use JSON.parse(JSON.stringify)) to create a deep copy

  data: function () {
    return {
      metadata: JSON.parse(JSON.stringify(store.state.defaultmetadata))
    }
  },

Leave a comment