vue element input让浏览器不保存密码

从网上看了很多,

比如  auto-complete="new-password"   

比如  autocomplete="off"

这是真的用不了啊,最后用css可以实现

1、html

2、data

reach__vioSecretkey: '', // 违纪秘钥
reach__seePwd: false,

3、methods

seePwd() {
  this.reach__seePwd = !this.reach__seePwd
},

4、css


.miyaoWrap{
  .no-autofill-pwd {
    ::v-deep .el-input__inner {
      -webkit-text-security: disc !important;
    }
  }
  .el-icon-view {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
  }
}

你可能感兴趣的:(vue.js,elementui,javascript)