话不多说,直接上代码,绝对有效
// html
<el-form>
<input type="password" class="hide" id="passWord"/>
<input type="text" class="hide" id="userName"/>
<el-form-item label="账号:" prop="userName">
<el-input v-model="userInfo.userName" autocomplete="off" placeholder="请输入账号"></el-input>
</el-form-item>
<el-form-item label="密码:" prop="passWord">
<el-input v-model="userInfo.passWord" autocomplete="off" type="password" placeholder="请输入密码"></el-input>
</el-form-item>
</el-form>
// css
<style>
.hide{
width: 0;
position: absolute;
border: 0;
}
</style>
主要是两个 input
替代了填充的 el-input
组件