VUE 回車鍵事件

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

案例:

 HTML代碼:

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

 JS代碼:

   queryFunction(){
      console.log('名字檢索 =',this.nameQuery)
      
      //業務代碼
    },

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章