mpvue WeChat applet input clicks on the keyboard to search to trigger the confirm event

In the template part, the
keyboard needs to set confirm-type=”search” for search input, complete, go to, send, go to the official website to see, the official input introduction website of the applet

<input confirm-type="search" v-model="keyword" placeholder="你想去哪?" @confirm="confirm($event)">

methods section

// 小程序 点击搜索 按钮时  事件
confirm(e) {
  debugger

},

Enter 666, click search, let's look at the value of value, of course, the data binding we use in this place is not used, just briefly mention it here, everything you need can be found in it...

e.target.value666

write picture description here

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325564142&siteId=291194637