微信小程序更加方便的获取多个input
<input class="input-items" bindinput="handleInput" value="{{name}}" data-info="name" type="text" placeholder="请输入物品名称"/>
<input class="input-items" bindinput="handleInput" value="{{time}}" data-info="time" type="text" placeholder="请输入丢失/拾取时间"/>
<input class="input-items" bindinput="handleInput" value="{{addr}}" data-info="addr" type="text" placeholder="请输入丢失/拾取地点"/>
<input class="input-items" bindinput="handleInput" value="{{call}}" data-info="call" type="text" placeholder="如何联系你?如:qq123456789等"/>
Page({
data:{
name:'',
time:'',
addr:'',
call:''
},
handleInput(e){
let {value} = e.detail;
let {info} = e.currentTarget.dataset;
this.setData({[info]:value});
}
})