The input keyboard pops up when the vant component library clicks the selector

Problem Description

  1. When developing some h5 projects, the vant component library is often used when the project requires form business and contains selector input items. When clicking on the selector to pop up and select the piker, under normal circumstances we want to just pop up the selector to select. But sometimes the system input keyboard will pop up at the same time, obviously this is not the effect we want to see
  2. For example, the following situationinsert image description here

problem solved

  1. Bind the event focus to the van-filed input box component, indicating that it is triggered when the input box gets the focus, just call the following method
    forbid () {
          
          
      //禁止软键盘弹出
      document.activeElement.blur();
    }
    

Guess you like

Origin blog.csdn.net/lhh_gxx/article/details/128548074