由于浏览器数量众多,网上现有的解决方法总有这个浏览器行而其它浏览器不行的情况,比如 autocomplete=“off” 或者 autocomplete=“new-password” ,或者不给input设置id和name,或者js强制设置input value =’’,现在分享一个终极解决方法,chrome,QQ,360,edge,firefox 都适用,逻辑已经写在代码注释里了:
<label class="w80">验证密码:</label>
<div class="w250" >
<#--真假双输入框 防止自动填充,假输入框吸引自动填充火力,真输入框onfocus时改变type=password-->
<input id="confirmPwd1" type="password" disabled style="display: none;">
<input v-model="confirmPwd" id="confirmPwd" type="text" class="ipt_pub w100" onfocus="this.type='password'" >
</div>