npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

vuelscroller

v1.0.0

Published

#### Vue component designed for efficient content rendering and dynamic loading based on various strategies. Below is a detailed overview of its features and usage:

Downloads

29

Readme

Vue Virtual Api Scroller

Vue component designed for efficient content rendering and dynamic loading based on various strategies. Below is a detailed overview of its features and usage:

API Request & Render

<VuelScroller
    :api="{
      requestUrl: 'https://localhost:44336/api/get/',
      requestStrategy: 'slash', // 'slash' | 'query
      queryNames: { qty: 'my-qty', offset: 'my-offset' }, // if query strategy has been chosen
      listLength:getListLength(), // stops requesting when the list is exhausted.
    }"
    :settings="{
      loadPerScroll:1, // number (default = 1)
      initialQty:10 // initial objects qunatity to load,
    }"
>
    <template v-slot="{ item }">
      // Loaded item template
    </template>
  
    <template #loading>
      // place for your spinner - only for API MODE
    </template>
</VuelScroller>

If you want to fetch objects from your API in addition to rendering, use the API object. You need to provide a requestUrl, for example: https://yourpage.com/api/list/. Depending on whether you choose 'slash' or 'query' strategy, your API requests will look like this: https://yourpage.com/api/list/5/50 or https://yourpage.com/api/list?qty=5&offset=50. You can also override the query parameter names by setting queryNames in the API object.

Render-Only

If your focus is solely on rendering, you can omit the API options and directly pass a full list of objects to items in renderOnly parameter.

<VuelScroller
      :render-only="{
        items: test  
      }"
      :settings="{ 
        loadPerScroll: 2, 
        initialQty:10 
      }"
>
     <template v-slot="{ item }">
       // Loaded item template
     </template>
  
     <template #loading>
       // place for your spinner - only for API Mode
     </template>
</VuelScroller>

Props:

  • renderOnly (optional):

    • items: An optional array of items to display within the component. Only if you want to render a static list of items ( Render-Only mode ).
  • settings:

    • loadPerScroll: Specifies how items are loaded during scrolling. Can be "single" or a number indicating the quantity of items to load per scroll event.
    • initialQty: Specifies the initial quantity of items to load.
  • api (optional):

    • requestUrl: The base URL for API requests.
    • requestStrategy: Specifies the strategy for API requests, either "slash" for URL path parameters or "query" for URL query parameters.
    • queryNames: Optional object specifying query parameter names for "qty" and "offset".
    • listLength: Stops requesting when the list is exhausted. If your list updates on-the-fly you may ignore 'listLength' parameter