Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@lucas-labs/vue3-vsl

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@lucas-labs/vue3-vsl

Vuejs 3 virtual Scroll List Component

  • 0.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
39
decreased by-7.14%
Maintainers
1
Weekly downloads
 
Created
Source

🔎 @lucas-labs/vue3-vsl (virtual-scroll-list) is a Vuejs 3 component plugin. Heavily based on tangbc/vue-virtual-scroll-list. Basically the same but ported to Vuejs 3 + typescript + Composition API.

Install

npm

npm i @lucas-labs/vue3-vsl

pnpm

pnpm i @lucas-labs/vue3-vsl

yarn

yarn add @lucas-labs/vue3-vsl

Usage

<template>
    <header>hello!</header>

    <virtual-scroller :data-key="'id'" :data-sources="users" @tobottom="bottom">
        <template #header>
            <div class="list-header">...</div>
        </template>

        <template v-slot="{ item, index }">
            <div class="list-item">
                <div>#{{ index }}</div>
                <div>{{ item.id }} | {{ item.username }}</div>
            </div>
        </template>

        <template #footer>
            <div class="list-footer">...</div>
        </template>
    </virtual-scroller>
</template>

<script setup lang="ts">
    import { ref } from 'vue';
    import { VirtualScroller } from '@lucas-labs/vue3-vsl';

    const users = ref<{ id: number | string; username: string }[]>([]);

    const fetchUsers = () => {
        users.value = ...
    };

    const bottom = () => {
        // we reached the bottom of the list...
        // fetch more users maybe?
        ...
    };

    fetchUsers();
</script>

Use globally

// main.ts/main.js
import { createApp } from 'vue'
import App from './App.vue'

// import the plugin
import VirtualScrollerPlugin from '@lucas-labs/vue3-vsl';

const app = createApp(App);

// use the plugin to make it 
// available in all your components
app.use(VirtualScrollerPlugin);
app.mount('#app');

TODO

  • Add tests!

Keywords

FAQs

Package last updated on 18 Jun 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc