uni-app nvue concat追加数据过多时,更改数据内容出现卡屏停顿后才更新数据
uni-app nvue concat追加数据过多时,更改数据内容出现卡屏停顿后才更新数据
测试过的手机:
- iphone 11 pro
- iphone 12 mini
- 华为mete30
示例代码:
<!-- #ifdef H5 -->
<scroll-view :scroll-top="goodsScrollTop" class="u-p-t-20 u-p-b-20 flex bgWhite scroll_column" scroll-y :style="{height:(pageHeight-botHeight-safeArea.top-safeBottomHeiVal)+'px'}" :scroll-with-animation='true' @scroll="scroll">
<!-- #endif -->
<!-- #ifdef APP-NVUE -->
<list ref="list" @loadmore="loadmore" loadmoreoffset='10' :show-scrollbar="false" fixFreezing="true" class="u-p-t-20 u-p-b-20 flex bgWhite" :style="{height:(pageHeight-botHeight-safeArea.top)+'px'}">
<!-- #endif -->
<!-- #ifdef APP-NVUE -->
<cell v-if="list.length" v-for="(item,index) in list" :key="index" class="u-p-l-30 bgWhite">
<!-- #endif -->
<!-- #ifdef H5 -->
<view v-if="list.length" v-for="(item,index) in list" :key="index" class="u-p-l-30 bgWhite">
<!-- #endif -->
<goodsItem :item2="item" :isdel="true" :isforcart="isforcart" :index='index' @getshow="getshow" @getlinkGoods="getlinkGoods" @refresh="refresh" :isRecShort="true" @getinfo="getinfo" @getbtnType='getbtnType'></goodsItem>
<!-- #ifdef H5 -->
</view>
<!-- #endif -->
<!-- #ifdef APP-NVUE -->
</cell>
<!-- #endif -->
<!-- #ifdef APP-PLUS -->
<cell ref="top">
<!-- #endif -->
<nodata v-if="list.length===0" :isBack="true" buttonText="去逛逛"></nodata>
<!-- #ifdef APP-PLUS -->
</cell>
<!-- #endif -->
<!-- #ifdef APP-NVUE -->
</list>
<!-- #endif -->
<!-- #ifdef H5 -->
</scroll-view>
<!-- #endif -->
操作步骤:
- 页面中有两个分类元素。 默认 nvue 写一个列表 list 循环cell 组件 渲染出第一个列表。 loadmore的时候 不断去concat新的数据,一直loadmore。再次请求第二个分类元素 触发把list的循环数据置为空
- 应用商城搜索《冻品到家》点击。常购清单 切换 左侧分类
预期结果:
- 数据即时切换为新的数据
实际结果:
- 实际的效果如下:切换数据页面卡顿。具体是:清除当前屏幕显示的数据之后,页面之外的数据展现出来 清除清楚当前数据。 直到页面中的旧数据清理完毕。 再一次性展现出来 新的数据
bug描述:
- list包含循环cell元素,数据比较长的时候再去切换数据,出现明显卡顿,明显的回收旧数据的过程,数据列表长度越长卡顿的时间就越长,随后才渲染新的数据
更多关于uni-app nvue concat追加数据过多时,更改数据内容出现卡屏停顿后才更新数据的实战教程也可以访问 https://www.itying.com/category-93-b0.html
2 回复
请求官方重视,当前app 影响正常使用
更多关于uni-app nvue concat追加数据过多时,更改数据内容出现卡屏停顿后才更新数据的实战教程也可以访问 https://www.itying.com/category-93-b0.html


