时间:2022-12-06 01:51
小程序获取页面上多个input值的案例:
//wxml<inputclass="formInput"placeholder="请输入旧密码"passwordplaceholder-class="placeholderStyle"bindinput='inputWacth'data-model="oldPassword"></input>
<inputclass="formInput"placeholder="请输入新密码"passwordplaceholder-class="placeholderStyle"bindinput='inputWacth'data-model="newPassword"></input>
//js
data:{
oldPassword:'',
newPassword:''
},
inputWacth:function(e){
console.log(e);
letitem=e.currentTarget.dataset.model;
this.setData({
[item]:e.detail.value
});
},