加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 大数据 > 正文

小程序:动态监测input和取值

发布时间:2020-12-14 04:37:34 所属栏目:大数据 来源:网络整理
导读:1.输入框失去焦点取值 wxml: input bindblur="tab" type=‘text‘/input js: tab:function(e){ console.log(e) } ? 2.动态监测input输入的值 wxml: input type=‘number‘ bindinput=‘change‘ placeholder="请输入" placeholder-class="placeholder" focus

1.输入框失去焦点取值

  wxml:

    <input bindblur="tab" type=‘text‘></input>
  js:
  tab:function(e){
    console.log(e)
  }
?
2.动态监测input输入的值
   wxml:
    <input type=‘number‘ bindinput=‘change‘ placeholder="请输入" placeholder-class="placeholder" focus="true"></input>
    focus 进入这个搜索页面后自动获取焦点
  js:
  change: function(r) {
    console.log(r.detail.value)
    this.setData({
      key: r.detail.value
    })
  },

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读