vue-infinite-scroll-component
v1.0.3
Published
An Infinite Scroll component in Vue
Downloads
4
Maintainers
Readme
Vue Infinite Scroll Component
Lightweight infinite scroll component for Vue < 5k 😎
Usage
npm i vue-infinite-scroll-component
<script setup>
import InfiniteScrollComponent from 'vue-infinite-scroll-component';
import 'vue-infinite-scroll-component/dist/style.css';
const options = {
fetchData,
};
async function fetchData() {
const res = await fetch('https://.../texts/works.json');
return await res.json();
}
</script>
<template>
<Suspense>
<InfiniteScrollComponent :options="options" v-slot="slotProps">
<!-- your component -->
<ul>
<li v-for="item in slotProps.items">
{{item.title}}
</li>
</ul>
</InfiniteScrollComponent>
</Suspense>
</template
Contact
Feel free to ping me 💫 [email protected]