uniapp scroll-view 设置自动滚动 并开启scroll-with-animation后 自动滚动到一定位置后 卡死不在滚动 下附代码 滚动到第九位置就会卡死
<scroll-view scroll-x :scroll-left="data.scrollLeft" @scroll="scroll" scroll-with-animation='true' >
<view class="top10-list">
<view class="top10-item" v-for="(item, index) in props.dataList" @click="clickAtIndex(index)">
<view class="order" :class="item.ranking <= 3 ? 'order-top3' : ''">TOP {{item.ranking}}</view>
<!-- <image :src="item.avatar|| '/static/My/ic_default_avatar.png'" mode="aspectFill" class="cover-img"></image> -->
<view
class="cover-img"
style="background-position: top center;background-size: cover;"
:style="{'background-image': 'url(' + (item.avatar || '/static/My/ic_default_avatar-new.png') + ')'}"
></view>
<view class="name">{{item.userName}}</view>
<view class="credit">{{item.totalScore}}积分</view>
</view>
</view>
</scroll-view>
data.timer = setInterval(() => {
if (props.dataList.length > 4) {
if (data.scrollLeft >= uni.upx2px(224 * (props.dataList.length - 4))) {
data.scrollLeft = uni.upx2px(1)
} else {
data.scrollLeft += uni.upx2px(1)
}
}
}, 50)
1 个回复
看啥呢
咋解决的,也遇到这个问题了