返回
顶部

修改密码

微信小程序-input密码可见与不可见

+1

-1

收藏

+1

-1

点赞0

评论0

wxml 密码js data: {password:"",isShowImg: false,isPassword: true,canIUse: wx.canIUse('button.open-type.getUserInfo')},passwordInput: function (e) {let password = e.detail.valuethis.setData({password,isShowImg:true})},

wxml

复制代码
      <view class="form_section">
        <view class="form_section_title">密码</view>
        <view class="form_section_cell">
          <input class="weui-input" name="input" password='{{isPassword}}' bindinput="passwordInput" type="text" placeholder="请输入登录密码" placeholder-style="color: #BFC6CB;" />
          <image wx:if="{{isShowImg}}" class='showImg' bindtap='showPassword' src="{{isPassword ? 'img/common_btn_unlook.png' : 'img/common_btn_look.png' }}"></image>
        </view>
      </view>
复制代码

js

复制代码
  data: {
    password:"",
    isShowImg: false,
    isPassword: true,
    canIUse: wx.canIUse('button.open-type.getUserInfo')
  },

  passwordInput: function (e) {
    let password = e.detail.value
    this.setData({
      password,
      isShowImg:true
    })
  },
复制代码

扫一扫在手机打开

评论
已有0条评论
0/150
提交
热门评论
相关推荐
微信小程序开发中常见的设计败笔
  • 开发资料
  • 2022-05-20 18:35
  • 14 0 0
+1
从王者荣耀里我学会的前端新手指引
  • 开发资料
  • 2022-05-20 18:35
  • 47 0 0
+1
微信小程序登录鉴权与获取用户信息
  • 开发资料
  • 2022-05-20 18:35
  • 4 0 0
+1
小程序录音功能实现
  • 开发资料
  • 2022-05-20 18:35
  • 26 0 0
+1
今日要闻
换一批
热点排行