<picker mode="region" bindchange="bindRegionChange" value="{{region}}" custom-item="{{customItem}}">
<view class="picker">
{{region[0]}}{{region[1]}}{{region[2]}}
</view>
</picker>
怎么根据当前坐标获取的区县,设置选择器的数值呢?谢谢
<picker mode="region" bindchange="bindRegionChange" value="{{region}}" custom-item="{{customItem}}">
<view class="picker">
{{region[0]}}{{region[1]}}{{region[2]}}
</view>
</picker>
怎么根据当前坐标获取的区县,设置选择器的数值呢?谢谢
1 个回答
bindRegionChange(e) {
this.setData({
region: e.detail.value
});
//省市区如下
console.log('region[0]'+this.data.region[0]);
console.log('region[1]'+this.data.region[1]);
console.log('region[2]'+this.data.region[2]);
},