uniapp取消浏览自动填充

为了防止浏览器自动将记住的密码回填进type="password"输入框,所以在type="password"输入框上面加了两行代码,使浏览器将密码填充到新加的输入框里,并将这两个input隐藏掉

html 复制代码
<input type="password" autocomplete="off" style='width:0;height:0;min-height:0'>
<input type="text" autocomplete="off" style='width:0;height:0;min-height:0'>

但是出现一个问题是点击tab键时会跳到这两个input里

在原生html中可以添加tabindex="-1"属性,点击tab时会自动跳过这个input

html 复制代码
    <input placeholder="第一个input">
    <input tabindex="-1" placeholder="第二个input">
    <input placeholder="第三个input">

但是uniapp中的input没有这个属性

可以使用这个(:disabled="true")来代替,能够实现一样的功能

html 复制代码
<input :disabled="true" type="password" autocomplete="off" style='width:0;height:0;min-height:0'/>
<input :disabled="true" type="text" autocomplete="off" style='width:0;height:0;min-height:0'/>
相关推荐
君顾116 小时前
代驾跑腿业务系统实战开发指南
java·开发语言·代驾跑腿
hxhy0016 小时前
服务器挖矿排查与清理
运维·服务器
lightqjx16 小时前
VS Code连接Linux远端服务器的方法
linux·服务器·vs code
琥珀色糖17 小时前
Linux GDB调试
linux·运维·服务器·gdb·调试
NGINX开源社区17 小时前
NGINX Ingress Controller 5.5:安全性与性能提升,迁移更轻松
java·服务器·nginx
云烟成雨TD17 小时前
Micrometer 系列【25】Spring Boot Actuator | Spring MVC、Spring WebFlux 指标
java·spring boot·micrometer
weixin_3077791317 小时前
PHP 大文件上传:内存占用、超时与最佳实践
linux·服务器·开发语言·nginx·php
国际云,接待17 小时前
云服务器 SSH 被扫爆了怎么办:安全组、密钥登录与 Fail2ban 的完整加固清单
服务器·安全·ssh
liudashuang201717 小时前
Kafka Producer 隐藏深坑:Sender 线程自阻塞(自死锁)导致 BufferExhaustedException 完整复盘
java·分布式·kafka·linq
风筱17 小时前
Idea的CC GUI插件安装Claude Code SDK失败
java·ide·ai编程