小程序的事件 bindtap bindinput
发布时间:2020-12-14 05:15:50 所属栏目:大数据 来源:网络整理
导读:一、bindtap事件 在wxml文件里绑定: view class=‘wel-list‘ bindtap=‘TZdown‘ image src="/images/welcome_08.png"/image textC语言资料下载/text /view ? 在js文件里相应: Page({ TZdown: function () { wx.navigateTo({ url: ‘../download/download
一、bindtap事件在wxml文件里绑定: <view class=‘wel-list‘ bindtap=‘TZdown‘> <image src="/images/welcome_08.png"></image> <text>C语言资料下载</text> </view> ? 在js文件里相应: Page({ TZdown: function () { wx.navigateTo({ url: ‘../download/download‘ }); } }) ? 二、bindinput事件wxml文件: <input type="number" placeholder="请输入手机号" class="inp-holder" maxlength="11" bindinput="getPhone" /> js文件: // 拿到手机号 getPhone: function (e) { var val = e.detail.value; this.setData({ telphone: val }); },// 拿到验证码 getCode: function (e) { var val = e.detail.value; this.setData({ code: val }); }, ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? <input type="number" placeholder="请输入手机号" class="inp-holder" maxlength="11" bindinput="getPhone" /> (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |