<!-- detail.wxml --> <view class="picker"> <picker range="{{range}}" bindchange="pickerChange"> 选择数量: <text>{{num}}</text> </picker> </view> // detail.js Page({ data:{ range: [ 1, 2, 3, 4, 5, 6, 7, 8, 9], num:0, }, pickerChange(e){ var rangeIndex=e.detail.value; // 下标 this.setData({ num: this.data.range[rangeIndex] }) } })
小程序-picker组件选择数量
猜你喜欢
转载自www.cnblogs.com/wuqilang/p/12074986.html
今日推荐
周排行