1. autocomplete="off" input添加autocomplete属性
2.<form autocomplete="off"> 在表单标签上添加autocomplete="off"属性。有些浏览器可能会尊重表单级别的autocomplete属性。
3. 最上面增加一个隐藏的表单,自动填充密码会填充在隐藏表单里面
具体生效看浏览器自身,可以1,2,3方法全部使用最佳
<div class="opacity"> <el-form-item label="账号" > <el-input v-model="name" autocomplete="off" placeholder="请输入账号"></el-input> </el-form-item> <el-form-item label="密码"> <el-input v-model="password" autocomplete="off" placeholder="请输入密码" type="password" show-password></el-input> </el-form-item> </div> <el-form-item label="账号" prop="realName"> <el-input v-model="form.realName" autocomplete="off" placeholder="请输入账号"></el-input> </el-form-item> <el-form-item label="密码" prop="realPassword"> <el-input v-model="form.realPassword" autocomplete="off" placeholder="请输入密码" type="password" show-password></el-input> </el-form-item> .opacity { opacity: 0; width: 0px; height: 0px; overflow: hidden; }
标签:opacity,填充,表单,autocomplete,input,0px,账号密码 From: https://www.cnblogs.com/zerofan/p/17648480.html