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-06-04
  • 2022-12-23
  • 2021-11-29
  • 2022-12-23
  • 2022-12-23
  • 2021-11-21
  • 2021-12-10
  • 2022-12-23
猜你喜欢
  • 2022-01-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-02
  • 2022-12-23
  • 2021-11-10
相关资源
相似解决方案