[Vuejs]-Reactive component / update component ( modal ) Vue Js

0👍

In modal.vue of your codesandbox, uses one watch or computed property to get latest infosModal (watch will be triggered or computed property will be re-calc when the dependencies are changed). And timeline.vue should do same thing.

For example, in modal.vue, adds below:

  watch: {
    'infosModal': function (newVal) {
      this.test = newVal
    }
  },
  computed: {
    computedInfosModal: function() {
      return Object.assign({}, this.infosModal);
    }
  },

Updated CodeSandBox

Leave a comment