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

vv-scrollbar

v1.0.3

Published

一个轻量级的虚拟滚动条组件,支持水平和垂直滚动,适用于Vue项目。

Readme

Vue Virtual Scrollbar 组件库

一个轻量级的虚拟滚动条组件,支持水平和垂直滚动,适用于Vue项目。

特性

  • 支持水平和垂直滚动条
  • 自定义滚动条宽度
  • 平滑的滚动体验
  • 支持RTL布局
  • 支持仅引入滚动条

安装

npm install vv-scrollbar
# 或者使用 yarn
yarn add vv-scrollbar
# 或者使用 pnpm
pnpm add vv-scrollbar

使用方式

简单用法


<template>
  <Scroll class="scroll-container" barWidth="8" @scroll="onScroll">
    <div class="long-content"></div>
  </Scroll>
</template>
<script setup lang="ts">
import { Scroll } from "vv-scrollbar";

function onScroll(e: Event) {
    console.log(e)
}
</script>
<style scoped>
.scroll-container {
  width: 100%;
  height: 300px;
}

.long-content {
  height: 3000px;
}
</style>

高级用法

<template>
    <div class="scroll-container">
        <div ref="content" class="scroll-content" @scroll="onScroll">
            <div class="long-content">xxx</div>
        </div>
        <ScrollBar type="vertical" :scrollHeight="scrollHeight" :scrollTop="scrollTop" :barWidth="8" @update:verticalTop="scrollToTop" />
        <ScrollBar type="horizontal" :scrollWidth="scrollWidth" :scrollLeft="scrollLeft" :barWidth="8" @update:horizonLeft="scrollToLeft" />
    </div>
</template>

<script setup lang="ts">
import { ref } from 'vue'
import { Scrollbar, useScroll } from "vv-scrollbar";

const content = ref<HTMLDivElement>(null);

const { scrollLeft, scrollTop, scrollWidth, scrollHeight, onScroll, scrollToTop, scrollToLeft } = useScroll(content);

</script>
<style scoped>
.scroll-container{
    position: relative;
    width: 100%;
    height: 300px;
}

.scroll-content{
    overflow: auto;
    height: 100%;
    width: 100%;
    
    &::--webkit-scrollbar {
        display: none;
    }
}

.long-content{
    height: 3000px;
    width: 4000px;
}
</style>

API

Scroll

属性

| 属性名 | 类型 | 默认值 | 说明 | |-----|-----|----|-----| | barWidth | number | 8 | 滚动条宽度 | | direction | 'ltr' | 'rtl' | 'ltr' | 布局方式,ltr表示从左到右,rtl表示从右到左 |

事件

| 事件名 | 类型 | 说明 | |-----|-----|-----| | scroll | Event | 滚动事件 |

方法

| 方法名 | 说明 | |-----|-----| | scrollTop | 滚动条顶部位置(支持set, get) | | scrollLeft | 滚动条左侧位置(支持set, get) |

ScrollBar

属性

| 属性名 | 类型 | 默认值 | 说明 | |-----|-----|----|-----| | barWidth | number | 8 | 滚动条宽度 | | type | vertical | horizontal | 滚动条类型 | | scrollHeight | number | 0 | 滚动内容高度 | | scrollWidth | number | 0 | 滚动内容宽度 | | scrollLeft | number | 0 | 滚动条左侧位置 | | scrollTop | number | 0 | 滚动条顶部位置 | | direction | 'ltr' | 'rtl' | 'ltr' | 布局方式,ltr表示从左到右,rtl表示从右到左 |