scroll-view 追加数据会自动回到顶部,请问怎样解决?
没有把数组值全部替换,是不断将数据追加push进数组。 基础库版本:2.10.3 const updateList = `tabs[${activeTab}].list[${page}]`
const updatePage = `tabs[${activeTab}].page`
this.setData({
[updateList]: res,
[updatePage]: page + 1
})
<!-- 这是自定义组件的内部WXML结构 -->
<scroll-view class="tab-content" enable-back-to-top="{{true}}" scroll-y="{{true}}" scroll-anchoring="{{true}}" lower-threshold="100" bindscrolltolower="updateGameList">
<view class="game-card-wrap" wx:for="{{gameListWrap}}" wx:for-item="gameList" wx:for-index="gameListIdx" wx:key="gameListIdx">
<view class="game-card" hover-class="hover-class" hover-start-time="100" wx:for="{{gameList}}" wx:for-item="game" wx:for-index="gameIdx" wx:key="gid">
</view>
</view>
</scroll-view>