<!-- wxml -->
<picker bindchange="changePicker" value="{{i}}" range="{{list}}">
<!-- 注意这一层不能少,否则弹性布局失效 -->
<view class="jcsb">
<view class="picker-value">{{list[i]}}</view>
<van-icon name="arrow" class="project-arrow" />
</view>
</picker>
/* wxss */
.jcsb {
display: flex;
justify-content: space-between;
align-items: center;
}
.picker-value {
padding-left: 20rpx;
}
.project-arrow {
font-size: 36rpx;
}
// js
Page({
data: {
i: 0,
list: []
},
changePicker(e) {
this.setData({
i: e.detail.value
})
},
})
标签:picker,触发,自定义,微信,list,value
From: https://www.cnblogs.com/dailyStudy/p/16635997.html