按照官方示例调用Picker下拉组件,发现每打开点击Picker两次才能改变js里通过data-取到的值,希望大佬们帮帮忙,看看是哪里有问题,谢谢
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" >
<input class="picker" type="text" id="jyyhmc" name="jyyhmc" value="{{list1[id].name}}" disabled="true" style="float:left" />
</picker>
input换成text组件试试