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

vue-list-view

v0.5.0

Published

ListView for Vue.

Downloads

2

Readme

ListView for Vue

Inspired by

  • https://github.com/emberjs/list-view
  • Google plus web-app

Features

  • Auto GC/restore invisible/visible list items
  • Does not modify the original data (the list or the items)

Demo

Requirements

  • vue 1.0+

Usage

  1. Define an itemComponent
    It's just a plain vue component object, except for it's props will be force overridden to only accept an item, which is an item in the list. So you should just leave the props option empty.
    import foo from 'foo';
    const itemComponent = {
        template: '<foo :some-prop="item"></foo>',
        components: {foo}
    }

itemComponent serves as an adaptor for list data, for example, normally you would do html <foo v-for="item in listToRender" :some-prop="item"> The data is passed through list -> v-for -> item -> foo With list-view, it is now html <list-view :items="listToRender"> ...internal v-for for demonstration, you needn't write the following... <template v-for="item in items"> <item-component :item="item"> ...The is the template of itemComponent... <foo :some-prop="item"></foo> ...template end... </item-component> </template> ...internal v-for end... </list-view> And The data is passed through list -> listView -> item -> foo

  1. Instantiate a listView component object
    const listView = ListView(itemComponent)

You can of course give it some other name like albumListView.

  1. Add listView to some other component's components and use it in template
    const someComponent = {
      template: '<list-view :items="myArr"></list-view>',
      components: {listView},
      data: () => ({
        myArr: [1,2,3]
      })
    }

or simply use it like javascript new Vue({ el: 'body', components: {listView}, template: '<list-view :items="myArr"></list-view>', data: { myArr: [1,2,3] } })

ListView Component

Props

  • items
    The list to be rendered (v-for-ed)
  • preloadScreens
    The preload margin measured in screen's height, set to 0 if you don't want preloading (not suggested)

Events

  • list-view:scrolled-to-end
    Dispatched when scrolled to end, can be used as a signal to load more data

Slots

  • list-start, list-end
    Placed before/after the list, can be used to display a loading status