企业🤖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> ```