SOURCE

console 命令行工具 X clear

                    
>
console
new Vue({
  el: "#app",
  data: {
    title: 'dataTitle',
    count: 0,
    sum: 0
  },
  methods: {
  	resultCount: function(){
    console.log("触发resultCount方法!!!");
    		return this.count > 3 ?  "count大于三" : "count小于三";
    }
  },
  computed: {
  	resultSum(){
    	console.log("触发resultSum方法!!!");
    	return this.sum > 3 ?  "sum大于三" : "sum小于三"
    }
  }
})
<div id="app">
  <button @click="count++">
    <span>加count</span>
  </button>
  <button @click="count -= 2">
     <span>减count</span> 
  </button>
  
  <button @click="sum++">
    <span>加sum</span>
  </button>
  <button @click="sum -= 2">
     <span>减sum</span> 
  </button>
<div>