picker是分为普通picker, 日期选择, 省市区
<view class="fliter">
<!-- <view class="section__title">普通选择器</view> -->
<view class="filter_item">
<picker bindchange="bindPickerChange"
value="{{setIndex}}"
range="{{activityArr}}"
range-key="label">
<view class="picker">
{{activityArr[setIndex].label}}
<image src='../../assets/arrow.png' />
</view>
</picker>
</view>
js中的写法
activityArr: [
{ id: 1, label: '展会活动' },
{ id: 2, label: '促销活动' },
{ id: 3, label: '节日活动' },
{ id: 4, label: '答谢活动' }
],
bindPickerChange (e) {
console.log("e",e);
this.setData({
setIndex: parseInt(e.detail.value)
})
},