ThinkChat🤖让你学习和工作更高效,注册即送10W Token,即刻开启你的AI之旅 广告
[TOC] ## useInfiniteScroll 下拉滚动 ``` <script setup lang="ts"> import { ref } from 'vue' import { useInfiniteScroll } from '@vueuse/core' const el = ref<HTMLElement>(null) const data = ref([1, 2, 3, 4, 5, 6]) useInfiniteScroll( el, () => { // load more data.value.push(...moreData) }, { distance: 10 } ) </script> <template> <div ref="el"> <div v-for="item in data"> {{ item }} </div> </div> </template> ```