登录页面常用,登录后浏览器自动填充账号密码,非常不安全,一般为了方便都设置记住密码功能。
解决方法:
方法一
- 设置autocomplete为off,适用于普通文本框
<input type="text" autoComplete="off"/>
- 设置autocomplete为new-password,适用于密码输入框
<input type="password" autoComplete="new-password"/>
- elementui组件同样适用autoComplete属性。
方法二:
- 在输入框前边再加一个隐藏的输入框就可以
<!-- 账号 -->
<input type="text" style="display:none"></input>
<input type="text"></input>
<!--密码-->
<input type="password" style="display:none"></input>
<input type="password"></input>