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.value 为666