Scrollbar 滚动条

用于替换浏览器原生滚动条。

基础用法

横向滚动

最大高度

手动滚动

API

Attributes

属性名说明类型默认值
height滚动条高度string / number
max-height滚动条最大高度string / number
native是否使用原生滚动条样式booleanfalse
wrap-style包裹容器的自定义样式string / object
wrap-class包裹容器的自定义类名string
view-style视图的自定义样式string / object
view-class视图的自定义类名string
noresize不响应容器尺寸变化,如果容器尺寸不会发生变化,最好设置它可以优化性能booleanfalse
tag视图的元素标签stringdiv
always滚动条总是显示booleanfalse
min-size滚动条最小尺寸number20
id 2.4.0视图IDstring
role 2.4.0 a11y视图的角色string
aria-label 2.4.0 a11y视图的 aria-labelstring
aria-orientation 2.4.0 a11y视图的 aria-orientationenum

Events

事件名说明类型
scroll当触发滚动事件时,返回滚动的距离Function

Slots

插槽名说明
default自定义默认内容

Exposes

名称说明类型
handleScroll触发滚动事件Function
scrollTo滚动到一组特定坐标Function
setScrollTop设置滚动条到顶部的距离Function
setScrollLeft设置滚动条到左边的距离Function
update手动更新滚动条状态Function
wrapRef滚动条包裹的 ref 对象object

源代码

组件文档

贡献者