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

haku-scroll

v1.1.7

Published

vue滚动条组件

Downloads

22

Readme

haku-scroll Build Status

vue滚动条组件

示例图

示例DEMO

说明

:smiley: 一款定制化滚动条,目前仅兼容PC端,兼容性为IE9+,之后会考虑增加移动端的滚动功能。

示例具体可参考 App.vue页面

安装

npm install haku-scroll --save

引入

//全局注册组件
import hakuScroll from 'haku-scroll'
Vue.use(hakuScroll)

//单组件引用
import hakuScroll from 'haku-scroll'
new Vue({
    components: { ...hakuScroll }
})

区域 haku-block

组件调用

<haku-block>
...
</haku-block>

属性

属性名 | 类型 | 默认值 | 描述 ---|---|---|--- contentClass | String | - | 内容class样式 contentStyle | String | - | 内容style样式 anime | Boolean | true | 是否启用平滑移动效果 wheelstep | Number | 100 | 单步鼠标滚动距离 wheeltime | Number | 200 | 单步鼠标滚动时间 wheelseaing | String | 'sineOut' | 滚动时的运动曲线,参考 liike vertical | Boolean | true | 纵向滚动条是否展现 horizontal | Boolean | false | 横向滚动条是否展现 watchSubTree | Boolean | false | 是否监听子节点树 parentScroll | Boolean | false | wheel滚动事件延伸至父容器 hideButton | Boolean | true | 隐藏按钮

函数

函数名 | 参数 | 返回值 | 描述 ---|---|---|--- scrollTo | { x:Number,y:Numbere,anime:Boolean,... } | - | 滚动到某处 refresh | config | - | 刷新/重置滚动条基本属性 getScrollTop | - | Number | 获取距离视窗顶部的像素 getScrollLeft | - | Number | 获取距离视窗左边缘的像素

事件

事件名 | 返回参数 | 描述 ---|---|--- oninit | - | 组件初始化 ondestroy | - | 组件销毁


滚动条 haku-scroll

组件调用

<haku-scroll :value.sync="value" :max-value="maxvalue">
...
</haku-scroll>

属性

属性名 | 类型 | 默认值 | 描述 ---|---|---|--- disabled | Boolean | false | 是否禁用 hidden | Boolean | false | 是否隐藏 type | String | - | 滚动条类型(vertical/horizontal) min | Number | 0 | 可操作最小值 max | Number | 0 | 可操作最大值(0为不设最大值) step | Number | 0 | 步长(0为不设步长) size | Number | - | 滚动条滑块大小 value | Number | 0 | 滚动条滚动的值 maxValue | Number | - | 最大值 minValue | Number | 0 | 最小值 hideBtn | Boolean | true | 隐藏按钮

函数

函数名 | 参数 | 返回值 | 描述 ---|---|---|--- scrollTo | value, isAdd = false | - | 滚动到某处 refresh | - | - | 刷新/重置滚动条基本属性

事件

事件名 | 返回参数 | 描述 ---|---|--- oninit | - | 组件初始化 ondestroy | - | 组件销毁

未完成功能

  • [x] 基本功能
  • [x] 变化监听
  • [x] 鼠标中键滚动
  • [x] 自定义滚动条样式
  • [x] 支持TypeScript
  • [x] 自动隐藏
  • [x] 滚动限制
  • [x] 滚动事件钩子
  • [x] 禁用
  • [ ] 扩展至移动端
  • [ ] 拆分为独立js组件
  • [ ] 自定义工具按钮