1.html

<input type="text" @change="specifiName($event)" />//输入框的change事件
<input type="text" @input="specifiName($event)" />//输入框的输入事件
<input type="text" @keyup.enter="specifiName($event)" />//输入框的回车事件

 

2.js

var vm = new Vue({
    el: "#app",
    methods: {
      specifiName(e) {
        var that = this;
        var val = e.target.value;
        console.log(val);
      },
    }
});

 

相关文章:

  • 2021-11-14
  • 2022-01-02
  • 2021-09-27
  • 2021-12-02
  • 2022-12-23
  • 2021-11-10
  • 2021-06-04
  • 2021-12-09
猜你喜欢
  • 2022-01-23
  • 2022-12-23
  • 2021-09-17
  • 2021-10-20
  • 2022-12-23
  • 2022-12-23
  • 2021-09-17
相关资源
相似解决方案