针对chrome设置【auto-complete=off】属性无效问题进行了搜索,解决办法基于以下搜索记录(因搜索结果的方法实测在【搜索1:无输入内容时获取焦点依然会有密码提示框问题,搜索2也是该问题】,但是给我提供了思路,故记录一下此坑)
<el-input type="password" ref="password" v-show="inputType=='password'" v-model.trim="form.password" placeholder="请输入当前账户的登录密码"> </el-input>
<el-input type="text" ref="text" v-show="inputType=='text'" v-model.trim="form.password" placeholder="请输入当前账户的登录密码"> </el-input>
inputType: "text"
'form.password': {
immediate: true,
handler(val) {
this.inputChange(val);
}
}
inputChange(val) {
if (!val) {
this.inputType = "text";
} else {
this.inputType = "password";
}
// console.log('val', val, this.inputType);
this.$nextTick(() => {
if (this.$refs[this.inputType]) {
this.$refs[this.inputType].$refs.input.focus();
}
});
}
搜索结果如下:
结果1:https://blog.csdn.net/ta_huang/article/details/126852363
结果2:https://www.cnblogs.com/linjiangxian/p/15817796.html