在實際開發中會遇到,點擊input框之后要彈出用戶授權相關確認彈窗 ,這時input焦點還在 彈窗上邊 ,怎么取消呢 ,當隨便點擊一處 就取消了 ,但這並不是最好的解決方法 ,體驗上也不太好,
bindfocus 事件觸發后 怎么自動解除,
小程序不能模擬點擊事件,選擇調用bindblur也不好使,最終結局方法wx:if
<view class="v-p" wx:if="{{opacity==1}}"> <input name="phone" placeholder='請輸入手機號' type='number' class='p-txt' maxlength="11" bindfocus = 'inputfocus' bindblur = 'inputblur' bindinput='inputPhone' value='{{phoneVal}}'></input> </view>
一個wx:if ="{{opacity == 1}}" 相關函數做設置opacity數據為1顯示