收藏
回答

scroll-view 嵌套循环 IOS卡顿,如何解决?

两个scroll-view联动,左边是年份,右边是项目,在安卓上正常,IOS导致页面卡顿严重。

代码如下:

<scroll-view class="VerticalNav nav" scroll-y scroll-with-animation scroll-top="{{VerticalNavTop}}" style="height:calc(100vh - 375rpx);">
          <view class="cu-item flex align-center justify-center {{index==TabCur?'text-green cur':''}}" wx:for="{{listseries}}" wx:key="index" bindtap='tabSelect' data-id="{{index}}" wx:for-item="item">
            {{item.name}}
          </view>
        </scroll-view>
        <scroll-view class="VerticalMain" scroll-y scroll-with-animation style="height:calc(100vh - 375rpx);-webkit-overflow-scrolling : touch;" scroll-into-view="main-{{MainCur}}" bindscroll="VerticalMain">
          <view class="m-xs" wx:for="{{listseries}}" wx:key="index" id="main-{{index}}" style="background:white">
            <view class='cu-bar solid-bottom bg-white flex-sub'>
              <view class='action text-center' style="height: 50rpx">
                <text class='cuIcon-title text-green'></text> {{item.name}} </view>
            </view>
            <view class="mt-xs mb-xs">
              <view class="flex flex-wrap align-center">
                <view class="pl-xs text-xs basis-df flex align-center {{items.select==true?'status0':''}}" wx:for="{{cardset}}" style="height: 80rpx" wx:for-item="items" wx:key="indexs" catchtap="selectset" data-id="{{index}}" wx:if="{{item.name==items.list__pubTime}}">
                  <image src="{{items.list__img}}" class="mana mr-xs"></image>{{items.list__name}}
              </view>
              </view>
            </view>
          </view>
          <view class=" mb-df"></view>
        </scroll-view>
回答关注问题邀请回答
收藏

1 个回答

  • 风吹雨成花🌸
    风吹雨成花🌸
    2019-12-18
    bindscroll="VerticalMain"    scroll-view上绑定了这个方法,方法里有渲染数据吗
    


    2019-12-18
    赞同
    回复 3
    • 停电
      停电
      2019-12-18
      有的,右边列表滚动到相应的位置,左边的年份也跟着滚动
      2019-12-18
      回复
    • 风吹雨成花🌸
      风吹雨成花🌸
      2019-12-20回复停电
      如果滚动一下就渲染一次数据,肯定会卡顿呀
      2019-12-20
      回复
    • 停电
      停电
      2019-12-20
      谢谢大佬,解决了,嵌套循环用一个数组就可以了
      2019-12-20
      回复
登录 后发表内容
问题标签