<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;
}

相关文章:

  • 2021-04-23
  • 2021-09-22
  • 2021-11-06
  • 2021-11-09
  • 2021-07-20
  • 2021-09-03
猜你喜欢
  • 2022-01-21
  • 2021-09-30
  • 2022-12-23
  • 2021-08-30
  • 2021-09-07
  • 2021-09-02
  • 2021-08-11
相关资源
相似解决方案