pick-view 上划bug
使用
picker-view
picker-view-column
做省市区级联,只能向下滑动(滚动), 向上滑动(滚动)就会触发
enablePullDownRefresh
我
enablePullDownRefresh
设置是需要一些刷新
我以前不知道是自己没测出来还是就有这个问题
6 回复
请提供出现问题的机型和微信版本,以及能复现问题的简单代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)
我也出现了这个问题,在同时用到picker-view和enablePullDownRefresh时,往下滑动的操作时很难触发picker-view,或者2个都被触发。
我用的是官方的demo
< view > < view style = "width:100%;height:100vh;background:#333;color:#fff;" catchtouchmove = 'preventTouchMove' >{{year}}年{{month}}月{{day}}日</ view > < picker-view indicator-style = "height: 50px;" style = "width: 100%; height: 300px;position:fixed;bottom:0;left:0;background:#fff;" value = "{{value}}" bindchange = "bindChange" catchtouchmove = 'preventTouchMove' > < picker-view-column > < view wx:for = "{{years}}" style = "line-height: 50px" >{{item}}年</ view > </ picker-view-column > < picker-view-column > < view wx:for = "{{months}}" style = "line-height: 50px" >{{item}}月</ view > </ picker-view-column > < picker-view-column > < view wx:for = "{{days}}" style = "line-height: 50px" >{{item}}日</ view > </ picker-view-column > </ picker-view > </ view > |
const date = new Date() const years = [] const months = [] const days = [] for (let i = 1990; i <= date.getFullYear(); i++) { years.push(i) } for (let i = 1; i <= 12; i++) { months.push(i) } for (let i = 1; i <= 31; i++) { days.push(i) } Page({ data: { years: years, year: date.getFullYear(), months: months, month: 2, days: days, day: 2, value: [9999, 1, 1], }, bindChange: function (e) { const val = e.detail.value this .setData({ year: this .data.years[val[0]], month: this .data.months[val[1]], day: this .data.days[val[2]] }) }, preventTouchMove(e){} }) |
{ "enablePullDownRefresh" : true } |