微信小程序之滚动选择器(picker)
滚动选择采用的是picker组件,具体使用方法如下: 实例1: Page({ js: data:{ { id:1 , name: picker01}, { id:2 , name: picker02}, { id:3 , name: picker03}, { id:4 , name: picker04}, ], pickerListIdx:0, } bindPicker: function (e) { this .setData({ pickerListIdx: e.detail.value }); }, }) .wxml < picker bindchange = "bindPickerSale" value = "{{ pickerListIdx }}" range = "{{ pickerList }}" > < view class = "picker"> picker选择: </ view > < view class = "picker"> {{pickerList[ pickerListIdx ]}} </ view > </ picker > .wxss .picker { float: right ; text-align: right ; width: 35% ; } 实例2: Page({ js: data:{ pickerList: [ { name: "1