跳到主要内容

阻止允许 浏览器自动填充密码

· 阅读需 1 分钟
素明诚
Full stack development

autocomplete="new-password"

始终告诉浏览器这是新密码

<el-input
v-model="userForm.password"
class="loginInput"
type="password"
autocomplete="new-password"
show-password
placeholder="设置登录密码(数字+字母,8位以上)"
size="large"
@keydown.enter="loginVerification">
</el-input>

autocomplete="current-password"

告诉浏览器要记住密码

<el-input
v-model="userForm.password"
class="loginInput"
type="password"
autocomplete="current-password"
show-password
placeholder="请输入登录密码"
size="large"
@keydown.enter="loginVerification">
</el-input>

autocomplete="tel"

指定自动填充某些字段,该例子为字段填充手机号

<el-input
v-model="smsForm.mobilePhone"
class="loginInput mb20 mobilePhoneNumber"
placeholder="请输入手机号"
clearable
size="large"
autocomplete="tel">
</el-input>