Skip to content

Commit f0916e3

Browse files
committed
perf(index): 优化轮播图性能
- 在 swiper-item 组件上添加 wx:key 属性,提高渲染性能
1 parent 189e35c commit f0916e3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

source/pages/index/index.wxml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ See the Mulan PubL v2 for more details.
2828
<view class="recycle-view-container">
2929
<swiper bind:change="swiperChange" current="{{verListCurrent}}" duration="250"
3030
style="height:{{heightRecycle+'px'}};">
31-
<swiper-item wx:for="{{listOrder}}">
31+
<swiper-item wx:for="{{listOrder}}" wx:key="listOrder">
3232
<scroll-view bind:refresh="onRefresh" bindscroll="titleChange" class="qq-version-list" enable-passive
3333
enhanced scroll-top="{{topNum}}" scroll-with-animation scroll-y="{{true}}"
3434
show-scrollbar="{{false}}" style="height:{{heightRecycle+'px'}};"

0 commit comments

Comments
 (0)