点第一次失去焦点,点第二次input才被清空
直接贴代码
<view class='searchCon'>
<input type='text' placeholder='搜一搜这是什么垃圾?' value="{{inputVal}}" bindinput='searchInput' bindconfirm="seachBtn" placeholder-class="placeholderClass" focus='{{isfocus}}' />
<view class='closeBtn' bindtap='deleteBtn'><image src="../../imgs/close.png"></image></view>
// 搜索回删
deleteBtn(){
this.setData({
isfocus: false,
},()=>{
this.setData({
inputVal:''
})
})
},