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'/>
相关推荐
C雨后彩虹17 小时前
计算疫情扩散时间
java·数据结构·算法·华为·面试
2601_9498095917 小时前
flutter_for_openharmony家庭相册app实战+我的Tab实现
java·javascript·flutter
!chen17 小时前
linux服务器静默安装Oracle26ai
linux·运维·服务器
莫大33017 小时前
2核2G云服务器PHP8.5+MySQL9.0+Nginx(LNMP)安装WordPress网站详细教程
运维·服务器·nginx
vx_BS8133017 小时前
【直接可用源码免费送】计算机毕业设计精选项目03574基于Python的网上商城管理系统设计与实现:Java/PHP/Python/C#小程序、单片机、成品+文档源码支持定制
java·python·课程设计
2601_9498683617 小时前
Flutter for OpenHarmony 电子合同签署App实战 - 已签合同实现
java·开发语言·flutter
达文汐18 小时前
【困难】力扣算法题解析LeetCode332:重新安排行程
java·数据结构·经验分享·算法·leetcode·力扣
培风图南以星河揽胜18 小时前
Java版LeetCode热题100之零钱兑换:动态规划经典问题深度解析
java·leetcode·动态规划
2501_9277730718 小时前
imx6驱动
linux·运维·服务器
hy____12318 小时前
Linux_进程间通信
linux·运维·服务器