在项目开发期间发现谷歌浏览器有记住密码的功能,该功能有个问题就是一遇到input type=password就开始自动填充,同一个账户还好,就是bug了。找了一堆解决方案终于找到了办法,下面分享一下解决方案。1、不生效方案:<input type=“text” style=“display: none;” disabled autocomplete = “off”/><input type=“password” style=“display: none;” disabled autocomplete = “off”/><input autocomplete=“off” type=“text” /> <input autocomplete=“off” type=“text” onfocus=“this.type=‘password’” />附:在表单的情况下再加一个input隐藏的方式去填充,对我来说无效。谷歌版本 73.0.3683.86(正式版本) (64 位)解决方案:1、可以在不需要默认填写的input框中设置 autocomplete=“new-password” (亲测有效)<input type=“password” v-model=“form.password” class=“form_input” autocomplete=“new-password” placeholder=“请输入/>2、修改readonly属性<input type=“password” readonly onfocus=“this.removeAttribute(‘readonly’);”/> 这种方式的话感觉不如方案一来的好,不过也是可以的。还有其他的解决方案不过我没有试验,这两种是行之有效的办法。参考资料:https://blog.csdn.net/xw50550…https://stackoverflow.com/que…