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

@zhangzhengyi12/vue-scrollbars

v1.6.9

Published

基于 Vue 的 PC 端滚动组件 简单 轻量 高效

Readme

vue-scrollbars

GitHub Github file size npm node.js

基于 Vue 的 PC 端滚动组件 简单 轻量 高效 仅对原生滚动组件进行滚动条样式统一化处理,并添加自动隐藏,拖动滚动等常用功能,利用动态滚动宽度监测来填平平台之间的差异

github

github

if you like , click star , thanks!

DEMO

live-demo

使用示例请看 app.vue

How to use

sudo npm i @zhangzhengyi12/vue-scrollbars --svae

global regisiter

import Vue from 'vue'
import Scrollerbars from '@zhangzhengyi12/vue-scrollbars'
Vue.use(Scrollerbars)

OR in component

import Scrollerbars from '@zhangzhengyi12/vue-scrollbars'

// in vue component

export default {
  components: { Scrollerbars }
}
<scrollbars style="height:200px" autoHide>
  <!-- you content -->
</scrollerbars>

Props

| name | type | desc | default | | ------------------ | -------- | ----------------------------------------- | ------- | | autoHide | Boolean | auto hide scrollbar | false | | hideTime | Boolean | auto Hide Time | 1000 | | data | Array | on watch Data Change refresh Bar | [] | | displayBar | Boolen | display scrollbar | true | | listenScrollBottom | Function | Called when scrolling to the bottom | false | | scrollBottomHeight | Number | listenScrollBottom handler trigger height | 50 | | listenScrollRight | Function | Called when scrolling to the right | false | | scrollBottomHeight | Number | listenScrollRight handler trigger height | 50 |

APIS

| name | params | desc | | --------- | ------ | ----------------- | | refresh() | null | refersh scrollbar |

this.$refs.scrollbars.refresh()

Event

| name | params | desc | | ------- | ------------------- | ------------------- | | @scroll | scroll event object | native scroll Event |

特性

自动监测滚动条

这里了解这个组件的原理是利用 容器的 Overflow:hidden 属性 ,随后将 content 设置一个负的 marigin-bottom & margin-right 把滚动条顶出容器 已达到隐藏的效果 (一般来说这个值就是滚动条的宽度),但是在不同平台的不同设备上,这个宽度是不一致的,在我的 mbp15 inch 上 这个值是 15 像素,而在一台 windows 分辨率 1920*1080 的设备上,这个宽度为 17

The principle of understanding this component here is to use the container's Overflow:hidden property, and then set the content to a negative marigin-bottom & margin-right. The scroll bar is pushed out of the container to achieve a hidden effect (generally this value is the scroll bar) Width), but this width is inconsistent on different devices on different platforms. This value is 15 pixels on my mbp15 inch, and on a 1920*1080 windows resolution, this width is 17

所以我加入了一个动态检测滚动条宽度的功能,能够让滚动条自动适应你的设备

So I added a feature that dynamically detects the width of the scrollbar, allowing the scrollbar to automatically adapt to your device.

自定义

考虑再三还是还是没有加入 bar 的颜色等常用 Props, 如有需要,请使用样式优先级进行覆盖。