[Vuejs]-"Sync" two JS objects in Vue.js

0👍

watch: {
  objChangedByUser: function (value) {
    this.cloneOfobjChangedByUser = Object.assign({}, value);
  }
}

Or:

computed: {
  cloneOfObjChangedByUser: function () {
    return Object.assign({}, this.objChangedByUser);
  }
}

Leave a comment