学习链接:https://blog.csdn.net/yeshennet/article/details/79031012
<view class="section__title">省市区选择器</view>
<picker mode="region" bindchange="bindRegionChange" value="{{region}}" custom-item="{{customItem}}">
<view class="picker">
当前选择:{{region[0]}},{{region[1]}},{{region[2]}}
</view>
</picker>
Component({//模板
data:{
region: [‘广东省‘, ‘广州市‘, ‘海珠区‘],
customItem: ‘全部‘
}
methods: {
// 地区选择器
bindRegionChange: function (e) {
console.log(‘picker发送选择改变,携带值为‘, e.detail.value)
this.setData({
region: e.detail.value
})
}
}
})