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 🙏

© 2026 – Pkg Stats / Ryan Hefner

zj-refresh

v0.0.5

Published

## 安装方法

Readme

一个不成熟的滚动区域下拉刷新指令

安装方法


npm i zj-refresh

import zjRefresh from 'zj-refresh'
import 'zj-refresh/dist/style.css'
app.use(zjRefresh,下拉的内容的自定义组件 非必填 下面细说)

使用方法


//使用 v-refresh 指令给你的滚动区域添加刷新功能  v-refresh.80  可通过修饰符来自定义下拉距离

// v-refresh="refresh"  //触发刷新回调方法

import type {handleRefresh} from 'zj-refresh'

const refresh:handleRefresh = (stop)=>{

   setTimeout(()=>{

      stop(status?:boolean=true,delay?:number=1000) // 第一个参数表示刷新的成功或者失败  第二个参数默认 500 是调用stop后多久收起  也就是 刷新状态的文字显示多久 默认500

   },2000)

}

<div v-refresh="refresh" style="height: 300px;border: 1px solid red;overflow: scroll;">
   <div v-for="item in 1000">{{ item }}</div>
</div>

下拉内容自定义 use的第二个参数


这个是默认数据组件  自定义组件可以直接仿照这个

<template>
    <div class="zj-refresh-container">
        <div v-if="!data.packUp" style="display: flex;">
            <div v-if="data.active">刷新中</div>
            <div v-if="data.overstepDistance">释放刷新</div>
            <div v-if="!data.overstepDistance && !data.active" style="display: flex;">
                <div>下拉刷新</div>
            </div>
        </div>
        <div v-else>
            <div v-if="data.success">刷新成功</div>
            <div v-else="data.success">刷新失败</div>
        </div>
    </div>
</template>

<script lang="ts" setup>

export interface propsInterface {
    data: {
        active: boolean,   //刷新状态
        height: number,   //当前下拉高度
        clearTime: boolean,   //
        distance: boolean,   //阈值
        overstepDistance: boolean,  //当前高度是否超过阈值
        success: boolean,   //刷新状态
        packUp: boolean     //触发shop会更新为true
    }
}

defineProps<propsInterface>()

</script>

<style lang="scss" scoped>

.zj-refresh-container{
    font-size: 12px;
    color: #424242;
}

</style>