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'/>
相关推荐
十年Java程序媛9 分钟前
Java 接口和抽象类对比|Java8 新特性,抛弃老旧八股,正确选型
java·spring boot·后端
caoerzhong12 分钟前
JeeWMS 开源 WMS 部署避坑指南:Java 仓库管理系统的环境基线、四类根因与可复现交付
java·开发语言·开源
用户37215742613512 分钟前
Java 合并 PDF 文件:完整合并、指定页面合并与流合并
java
for_ever_love__1 小时前
MySQL 全文索引实战:FULLTEXT、ngram 中文分词与 MATCH AGAINST 到底该怎么用
java·python·mysql·全文检索·分词·索引·ngram
java资料站1 小时前
五、Spring AI Alibaba · Memory · Saver(短期会话)
java·spring·microsoft
xh didida1 小时前
Linux -- 基础IO
linux·服务器·开发语言·c++
心易行者2 小时前
Agent应用+API端点商业化进阶实战:从单体智能体到可付费调用的API全流程
运维·服务器·人工智能·python·apache
夜之眷属2 小时前
Core dump 崩溃排查:JVM 宕机后,那份 core 文件怎么用 gdb 还原现场
java·运维·服务器·jvm
波加曼大王2 小时前
# vLLM不要迷信PagedAttention神话,聊聊线上藏着的内部碎片陷阱
java·架构
zly35002 小时前
centos7 mount设备挂载 /dev/sda1/硬盘挂载
linux·运维·服务器