scroll 动态设置高度后无法触发下拉刷新,怎么解决?
发布于 5 年前 作者 ading 11964 次浏览 来自 官方Issues
<scroll-view scroll-y="true" 
style='height:{{scrollheight}}px' 
bindrefresherrefresh='toupper' 
bindscrolltolower="loadMore"   
scroll-with-animation="true" 
refresher-enabled='true' 
refresher-threshold="20" 
refresher-triggered='{{refresher}}' 
lower-threshold='100' 
data-index='{{index}}'>

如果height设置为固定的常数就可以触发refresher-enabled,
怎么解决?
3 回复

麻烦提供出现问题的具体机型、微信版本号、系统版本号,以及能复现问题的代码片段https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html

height属性的初始默认值(即scrollheight的默认值)不能为0

// 解决方案:

data: {
  scrollheight: 100
}

// or

style='height:{{scrollheight || 100}}px'

高度是正确的吗?看下你高度赋值了没有

回到顶部