首页 > 编程语言 >微信小程序自定义picker触发区域

微信小程序自定义picker触发区域

时间:2022-08-29 15:16:25浏览次数:75  
标签:picker 触发 自定义 微信 list value

<!-- 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

相关文章