微信小程序Picker为什么我调用后要下拉两次才能改变数值?求各位大佬帮帮忙看看是不是我调用有问题。
JS:
Page{
data:{ id:0 },
button1:funcation(e)
{
var that = this;
that.setData({
id: e.detail.value
});
wx.setStorageSync("name", e.currentTarget.dataset.selecthx)
wx.setStorageSync("name1", e.currentTarget.dataset.selecthx1)
}
}
wxml:
<picker class="cybm_pic_1" value="{{id}}" range="{{list1}}" range-key="name"
data-selecthx="{{list1[id].id}}" data-selecthx1="{{list1[id].name}}" bindchange="button1" >
https://developers.weixin.qq.com/s/WA2k7Pmx7lgY 这样写就行了
为什么老是报index is not defined