<button @click="handleAdd1()">add1</button>
<button @click="handleAdd2">add2</button>
<button @click="count++">add3</button>
不帶括號可以直接傳一個事件對象
帶括號的可以傳參。
<input type="text" @input="handleInput($event)" @keyup.65="handleKeyUp"/>
handleInput(ev){
console.log(ev.target.value);
this.mytext= ev.target.value;
}
還可以搞$event,加傳參
<input type="text" @input="handleInput($event,param)" @keyup.65="handleKeyUp"/>
handleInput(ev,param){
console.log(ev.target.value);
this.mytext= ev.target.value;
}