SOURCE

console 命令行工具 X clear

                    
>
console
var app = new Vue({
  el: '#app',
  data: {
    package1: [
      {
      	name: 'iPhone 7',
      	price: 8199,
      	count: 2  
      },
      {
      	name: 'iPad',
      	price: 2888,
      	count: 3
      }
    ],
    package2: [
      {
      	name: 'apple',
      	price: 3,
      	count: 3  
      },
      {
      	name: 'banana',
      	price: 2,
      	count: 3
      }
    ]
  },
  computed: {
    prices: function() {
			const packages = this.package1.concat(this.package2);
			return packages.reduce((acc,cur) => acc + cur.price * cur.count,0);
    }
  }
})
<script src='https://unpkg.com/vue/dist/vue.min.js'></script>
<div id="app">
  总价:{{ prices }}
</div>