Vue项目中input框focus时不调出键盘,亲测有效

在移动端,实现input框获得焦点的同时不会唤起手机键盘。亲测有效

 <input type="text" placeholder="收货地址" v-model="address3" @focus.prevent="showcountF" ref="address" />
 showcountF(){
      this.showcount=true;
       this.$refs.address.setAttribute('readonly', 'readonly');
    },
发布了21 篇原创文章 · 获赞 0 · 访问量 315

猜你喜欢

转载自blog.csdn.net/weixin_46337813/article/details/104659649