<input />

这里的重点是:@input="search($event)",表示当文本框有内容输入时,则调用search方法

/*模糊搜索*/
search: function (event) {
  //方法一:直接通过event.data可以获得文本内容
  if(event.data!=null){
    this.materialName = event.data;    
  }
  //方法二:获取DOM对象取value值
  this.materialName = event.currentTarget.value;
  //方法三:通过js获取
  this.materialName = document.getElementById("materialSearch").value;
}

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-11-30
  • 2022-12-23
  • 2023-01-09
  • 2022-12-23
  • 2022-12-23
  • 2022-03-09
猜你喜欢
  • 2022-12-23
  • 2021-12-26
  • 2021-05-02
  • 2021-10-06
  • 2021-11-30
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案