9433cfb9创建于 2025年12月31日历史提交
<template>
  <scroll-view @scroll="onScroll" style="flex: 1;">
    <view v-for="i in 60" class="content-item">
      <text class="text">item-{{i}}</text>
    </view>
  </scroll-view>
</template>

<script>
  export default {
    data() {
      return {
        count: 0,
        ret: true
      }
    },
    onLoad() {

    },
    methods: {
      onScroll() {
        this.count++
        console.log("scroll: ", this.count)
        uni.createSelectorQuery()
          .in(this)
          .selectAll('content-item')
          .boundingClientRect()
          .exec((result) => {
            this.count--
          })
        console.log("scroll: ", this.count)

        if (this.count > 0) {
          this.ret = false
        }
      }
    }
  }
</script>

<style>

</style>