关闭存储密码提示,需要 <input type="password" /> 之前不要有 <input /> ,可以伪造 <input />,然后使用相同的样式。 WXML: <input wx:if="{{showingRealInput}}" value="{{values.account}}" focus="{{focuses.account}}" bindblur="hideRealInput" /> <view wx:else bindtap="showRealInput" class="fake-input">{{values.account}}</view> JS: Page({ data: { focuses: {}, values: {}, showingRealInput: false, // this prevents auto-save password in iOS }, showRealInput() { this.setData({ showingRealInput: true, focuses: { account: true }, }) }, hideRealInput() { this.setData({ showingRealInput: false, }) }, })
input type="password" 如何不弹出“存储密码”?[图片] 如图所示,只要是 input type=‘password’ 的输入框,在输入密码后,就会自动弹出这个 “存储密码” 的提示,而且是每次都提示,真的很烦。 有没有什么办法可以不弹出这个提示框?
2022-04-21