input 控件監聽回車確認按鈕。


 

前端開發的同學捕捉回車按鍵經常會用到

if(event.keyCode == 13){
  console.log("點擊了回車按鍵");
}

但是在微信上面,我們一般會用到指令 bindconfirm

例子:<input class="top-input-view" placeholder="{{placeholder}}"  auto-focus = "true" bindinput="bindinput" bindconfirm="bindconfirm"/>

 

JS:

//點擊確定確定
bindconfirm:function(){
console.log("點擊了取消事件+++++");

}


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM