在input标签中有一个confirm-type 属性,即设置键盘右下角按钮的文字,仅在type='text’时生效
示例:
代码语言:javascript复制<input type="text" placeholder="搜索" confirm-type="search"/>confirm-type 有效值
send右下角按钮为“发送”search右下角按钮为“搜索”next右下角按钮为“下一个”go右下角按钮为“前往”done右下角按钮为“完成”
监听
bindconfirm函数
wxml:
代码语言:javascript复制<input type="text" placeholder="搜索" confirm-type="search" bindconfirm='doSearch'/>js:
代码语言:javascript复制 doSearch: function(e) {
console.log(e)
console.log(e.detail.value)
},


