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-virtual-list-v3

v1.5.6-beta.0

Published

vue3 version virtual list, refer to vue-virtual-scroll-list.

Downloads

180

Readme

VirtualList 虚拟列表 vue3 版本

当列表的数据量很大时,使用虚拟列表呈现内容。

组件注册

import VirtualList from 'vue-virtual-list-v3';

app.use(VirtualList);

在线示例

1、点我查看完整在线示例

2、pageMode live demo

基本用法

<div class="container">
     <VirtualList class="list-dynamic scroll-touch"
          :data-key="'id'"
          :data-sources="items"
          :estimate-size="80"
          :item-class="'list-item-dynamic'"
          ref="virtualList"
        >
        <template #={source}>
            <div class="item-inner">
                <div class="head">
                    <span># {{ source.index }}</span>
                    <span>{{ source.name }}</span>
                </div>
                <div class="desc">{{ source.desc }}</div>
            </div>
        </template>
      </VirtualList>
</div>

items 数据示例:

[
  {
    "index":1,
    "name":"0.8952834111006784",
    "id":"1$d9ec7a",
    "desc":"html5",
    "size":150
  }
]

响应式数据配置示例:

let items = ref([]); 
const addItem = () => {
    items.value.push({
        index: Math.random() * 1000 + 1,
        name: "Brad" + Math.random() * 1000 + 1,
        id: Date.now(),
        desc: "html5",
        size: 150,
    });
};

更新日志

1.5.5 版本修复dataSources变化时,列表不更新的问题

1.5.4 版本修复非pageMode模式下数据不更新问题

1.5.2 版本新增pageMode模式

1.5.0 版本新增 container-class 属性,用户可以自主设置高度/宽度

虚拟列表属性和方法

必须的属性

| 属性 | 类型 | 描述 | |------------------|------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | data-key | String|Function | 从data-sources中的每个数据对象获取唯一键。或者使用每个数据源调用函数并返回其唯一键。其值在数据源中必须是唯一的,用于标识每一项的尺寸。 | | data-sources | Array[Object] | 为列表生成的源数组,每个数组数据必须是一个对象,并且具有唯一的key get或generate fordata key属性。 |

其他属性

公共方法

Props type

Required props

|              Prop              | Type | Description | |------------------|------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | data-key | String|Function | The unique key get from data-sources in each data object. Or a function called with each data-source and return their unique key. Its value must be unique in data-sources, it is used for identifying item size. | | data-sources | Array[Object] | The source array built for list, each array data must be an object and has an unique key get or generate for data-key property. |

Optional props

Public methods