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 🙏

© 2025 – Pkg Stats / Ryan Hefner

hfex-list

v1.1.0

Published

下拉加载更多组件

Downloads

2

Readme

HfexList

下拉滚动加载组件

安装使用

npm安装

npm i hfex-list

vue组件引入(Vue2)

<hfex-list 
    v-model="flowLoading" 
    :finished="flowFinished" 
    :error="flowError" 
    @load="onLoad"
>
    <div 
    v-for="item in list" 
    :key="item"
    class="list"
    >
    {{ item }}
    </div>
</hfex-list>
import HfexList from 'hfex-list/dist/vue2/index.esm.js';

export default {
    data() {
        return {
            flowLoading: false,
            flowFinished: false,
            flowError: false,
            list: []
        }
    },
    components:{
        MList
    },
    methods:{
        onLoad() {
            //这里就模拟一下ajax请求
            //加载失败就把flowError设置为true即可,这里就不做显示了
            // 异步更新数据
            // setTimeout 仅做示例,真实场景中一般为 ajax 请求
            // 加载状态结束
            this.flowLoading = true;
            setTimeout(() => {
                this.flowLoading = false;
                for (let i = 0; i < 10; i++) {
                    this.list.push(this.list.length + 1);
                }

                // 数据全部加载完成
                if (this.list.length >= 40) {
                    this.flowFinished = true;
                }
                
            }, 1000);

        }
    }
}

vue组件引入(Vue3)

<script
    lang="ts"
    setup
>
import {ref} from 'vue';
import HfexList from 'hfex-list'; 
const list = ref<Array<number>>([]);
const flowLoading = ref(false);
const flowFinished = ref(false);
const flowError = ref(false);
const onLoad = () => {
    flowLoading.value = true;
    setTimeout(() => {
        flowLoading.value = false;
        for (let i = 0; i < 10; i++) {
            const length= list.value.length+1
            list.value.push(length);
        }

        // 数据全部加载完成
        if (list.value.length >= 40) {
            flowFinished.value = true;
        }
                
    }, 1000);
}
</script>

props

| Prop | Type | Default | description | | ---- | ---- | ---- | ---- | | finished | bool | false | 数据是否加载结束 | | finishedText | string | 没有更多了 | 数据全部加载结束提示词 | | loadingText | string | 加载中... | 数据加载中提示词 | | error | bool | false | 数据加载失败 | | errorText | string | 加载失败... | 数据加载失败提示词 | | immediateCheck | bool | true | 组件挂载时启动加载数据 | | pullupTipsBg | string | #f4f5f7 | 提示词容器背景色 |

截图示例

截图示例