代码如下:
组件list wxml文件
<scroll-view bindscrolltolower="lower" enable-back-to-top scroll-y style="width:100%;height:calc(100vh - {{onlysearch?115:188}}rpx);" scroll-top="{{y}}" bindscroll="bindscroll">
<block wx:key="{{index}}" wx:for="{{orders}}" wx:if="{{orders&& orders.length > 0 }}">
<order-item isrefund="{{isrefund}}" isservice="{{isservice}}" item="{{item}}" bind:orderdetail="orderdetail" > </order-item>
</block>
<wxc-abnor type="MESSAGE" title="暂时没有数据" wx:if="{{ !loading&&orders.length == 0 }}"></wxc-abnor>
<view id="loadmore" wx:if="{{isloadingmore}}">
<wxc-loadmore text="正在努力加载中...">
</wxc-loadmore>
</view>
</scroll-view>
组件list js文件
bindscroll(e) {
this.triggerEvent('scroll', e.detail.scrollTop)
}
引用组件的代码:
<list orders="{{orders}}" bind:orderdetail="handleDetailOrder" bind:lower="lower" loading="{{loading}}" isloadingmore="{{isloadingmore}}" bind:scroll="scroll" y="{{y}}"> </list>
onLoad() {
this.setData({ y: 0 })
},
scroll(data) {
this.setData({ y: data.detail })
},
你好,请提供一下出现问题的机型和微信版本,以及能复现问题的简单代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)。