<div id="app">
  <p-item name="iMac Pro"></p-item>
  <invoice-summary
     :amount="bus.totalAmount"
     :taxes="bus.totalTaxes"></invoce-summary>
</div>
var bus = new Vue({
  data: function() {
    return {
      totalAmount: 0,
      totalTaxes: 0 
    }
  }, 
  methods: {
    updateTotals: function(val, tax) {
      this.totalAmount = val;
      this.totalTaxes = tax;
    }
  }
});

Vue.component("invoice-summary", {
  props: ['amount', 'taxes'],
  template: `
    <p>
      Amount: {{ amount }} <br />
      Taxes: {{ taxes }}
    </p>
  `
});

Vue.component("p-item", {
  props: ['name'],
  data: function () {
    return {
      value: 1500
    }
  },
  template: `
    <div>
      {{ name }}
      <input type="number"
        v-model.number="value" step="100" />
    </div>
  `,
  computed: {
    tax: function() {
      return this.value * 0.2;
    }
  },
  watch: {
    value: function() {
      bus.$emit('value-changed', this.value, this.tax);
    }
  },
  created: function() {
    bus.$emit('value-changed', this.value, this.tax);
  }
});

var vue = new Vue({
  el: "#app",
  created: function() {
    this.bus = bus;
    bus.$on('value-changed', bus.updateTotals);
  }
});

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

  1. https://cdn.jsdelivr.net/npm/vue/dist/vue.js