zoukankan      html  css  js  c++  java
  • 微信小程序-input密码可见与不可见

    参考链接:https://blog.csdn.net/ansheng02/article/details/83743848

    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
        })
      },
  • 相关阅读:
    Ajax
    Linux安装SmartSVN及破解
    JQuery异步提交
    动画效果
    事件
    表单选择器
    DOM操作
    JQuery基础
    PHP环境配置
    DP--钢条切割
  • 原文地址:https://www.cnblogs.com/zhaomeizi/p/14442026.html
Copyright © 2011-2022 走看看