浏览器应该是再<input /> 有text和password类型时会自动填充密码
0. chrome
<Input autoComplete="new-user" placeholder="用户名"/>
<Input type="password" autoComplete="new-password" placeholder="密码" />
通过 autoComplete="new-user" autoComplete="new-password" 取消自动填充
1. 360浏览器
<Form.Item>
{getFieldDecorator('password', {
rules: [{ required: true, message: '请输入密码' }],
onChange: () => {
if(this.state.passwordInputType !== 'password') {
this.setState({passwordInputType: "password"});
}
}
})(
<Input type="password" autoComplete="new-password"
placeholder="密码"
/>,
)}
</Form.Item>
通过
onChange: () => {
if(this.state.passwordInputType !== 'password') {
this.setState({passwordInputType: "password"});
}
}
在密码值改变再设置密码框type类型来防止360浏览器自动填充