zoukankan      html  css  js  c++  java
  • 在微信里及QQ浏览器里ios短信回填vue方法取不到值,去除黄色背景

    在微信里打开的网页,或者在qq浏览器里打开网页,发生短信,ios系统自带的键盘上方有短信验证码,点击就会回填到输入框中,输入框就是正常输入框,啥属性都不需要加,但是vue的方式取值是空,自动回填后,手输也会取不到。

    1:没自动回填,手动输入可以取值;

    2:自动回填,取不到值;回填后,再手输入,取不到值;

    3:只有ios端(微信,qq浏览器)有问题;安卓端哪里都没问题;

    解决方法:

    document.getElementById('msgVerify').value;  用原生方法取值,直接取input输入框的值,实测没问题。

    去除自动填充的输入框黄色背景:

    input:-webkit-autofill{
      -webkit-box-shadow:0 0 0 1000px white inset;
      animation-name:autofill !important;
      animation-fill-mode:both !important;
    }
    @-webkit-keyframes autofill{
      to{
        background:transparent;
      }
    }
    input:-webkit-autofill,
    input:-webkit-autofill:hover,
    input:-webkit-autofill:focus{
      background-clip:content-box !important;
    }
    

      

  • 相关阅读:
    域运算符::
    类和结构体类型的异同
    4 链表组件(817)
    2 旋转链表(61)
    1、重排链表(力扣143)
    子字符串排序的关键代码
    C语言四舍五入
    约分
    python学习第八天
    python学习第七天
  • 原文地址:https://www.cnblogs.com/wulinzi/p/15627626.html
Copyright © 2011-2022 走看看