页面可左右滑动 下滑刷新 ;后端请求数据正常bbsList:140条
但是wxml仅能显示50条数据 再次下滑无页面未填充 setdata正常真机调试如下
此为wxml代码
<swiper current="{{currentTab}}" bindchange="swiperChange" duration='300' class="tab-content">
<swiper-item wx:for="{{categoryLists.length}}" wx:key="this">
<scroll-view scroll-y="true" bindscrolltolower="toLowFun" class="scoll-h">
<view wx:for="{{bbsList}}" wx:for-item="bbs" wx:key="bbs">
<view class="item-ans">
<view class="expertInfo">
<view class="review-item-head">
<view class="review-item-head-lf lm26 color-333">
<image class="review-avatar" bindtap="linkToIndDefenderOfFranceexDetailInfo" data-id="{{bbs.userManage.identity == 2 || bbs.userManage.identity == 1 ? '':bbs.userManage.id}}" src="{{bbs.userManage.headPic==''?avatarDefault:bbs.userManage.headPic}}" mode="aspectFill"></image>
</view>
<view class="review-avatar-right" bindtap="linkToBbsDetail" data-id="{{bbs.id}}">
<view class="title">
{{bbs.userManage.loginCode}}
<block wx:if="{{bbs.userManage.identity == 1}}" space="ensp">
<text class="color-999" style="margin-left:15rpx;">会员</text>
</block>
<block wx:if="{{bbs.userManage.identity == 2 && bbs.userManage.bodyguardType == ''}}" space="ensp">
<text class="color-999" style="margin-left:15rpx;">教师</text>
</block>
<block wx:else space="ensp">
<text class="color-999" style="margin-left:15rpx;">{{bbs.thingsClassify.classifyIdentity}}</text>
</block>
<text class="color-999" style="margin-left:220rpx;">{{bbs.time}}</text>
</view>
<view class="control">
<block wx:if="{{bbs.readNum > 0 }}" space="ensp">
<image style="width:38rpx;height:38rpx; " src="../../images/yanjing.png" mode="aspectFill" />
<text class="color-999" style="margin-left:5rpx;">{{bbs.readNum}}</text>
</block>
</view>
</view>
</view>
<view class="center">
<view class="article">
<view class="pay-hint-content {{bbs.showMore?'ellipsis':'unellipsis'}}">
{{bbs.explain}}
</view>
<view style="color: #1da39a;" wx:if='{{bbs.explain.length > 100}}' bindtap="linkToShowMoreExplain" data-id='{{bbs.id}}' data-showMore='{{bbs.showMore}}'>
{{bbs.showMore ? '显示更多':'收起'}}
</view>
</view>
<view class="bottom">
<view class="btn-left" bindtap="linkToBbsDetail" data-id="{{bbs.id}}">
<image class="" style="width:30rpx;height:28rpx;margin-top:15rpx;" src="{{baseImgUrl}}yingshixiangq_fenxiang.png" mode="aspectFill" />
<block wx:if="{{bbs.forwardNum != 0}}" space="ensp">
{{bbs.forwardNum}}
</block>
<block wx:else space="ensp">
转发
</block>
</view>
<view class="btn-left" bindtap="linkToBbsDetail" data-id="{{bbs.id}}">
评论
<block wx:if="{{bbs.replyNum != 0}}" space="ensp">
{{bbs.replyNum}}
</block>
</view>
<view class="btn-left" bindtap="zan" data-bbsid='{{bbs.id}}' data-tapStatus='{{bbs.tapStatus}}'>
<block wx:if="{{bbs.praiseNum != 0}}" space="ensp">
<image class="" style="width:32rpx;height:28rpx;margin-top:15rpx;" src="{{bbs.tapStatus==1?isZan:noZan}}" mode="aspectFill" /> {{bbs.praiseNum}}
</block>
<block wx:else space="ensp">
<image class="" style="width:32rpx;height:28rpx;margin-top:15rpx;margin-right:5rpx;" src="{{bbs.tapStatus==1?isZan:noZan}}" mode="aspectFill" />赞
</block>
</view>
</view>
</view>
</view>
</view>
</scroll-view>
</swiper-item>
</swiper>
不知该如何优化。。。
应该是元素太多停止渲染了。这个多了,就算不白屏也会变慢。用长列表组件代替吧。性能好,建议用:
recycle-view | 微信开放文档
https://developers.weixin.qq.com/miniprogram/dev/extended/component-plus/recycle-view.html
这个真厉害了🐂🍺
--↓↓👍点击“有用”是回答的动力哦