VUE 回车键事件

@keyup.enter.native="绑定事件 "

案例:

 HTML代码:

<el-input v-model="nameQuery" placeholder="姓名查询" @keyup.enter.native="queryFunction()" ></el-input>

 JS代码:

   queryFunction(){
      console.log('名字检索 =',this.nameQuery)
      
      //业务代码
    },

猜你喜欢

转载自blog.csdn.net/qq_42715494/article/details/101053659