原文連接:https://blog.csdn.net/Mr_dong_ya_yun/article/details/105473787
需求:搜索功能,要求使用手機(jī)軟鍵盤彈起搜索
<form action="" @submit.prevent="search">
<input class="search-input" type="search" placeholder="搜索姓名、身份證號、工廠名稱" v-model="searchVal">
</form>
type=search,不可省略,form為了兼容ios
// 搜索函數(shù)里面可以寫請求的函數(shù)
search(){
console.log(123123123)
// alert(1)
document.activeElement.blur();
}
請求完,H5頁面關(guān)閉軟鍵盤:
document.activeElement.blur();
親測有效,記錄一下