Scrollbar
Used to replace the browser's native scrollbar.
Basic usage
Horizontal scroll
Max height
Manual scroll
API
Attributes
Name | Description | Type | Default |
---|---|---|---|
height | height of scrollbar | string / number | — |
max-height | max height of scrollbar | string / number | — |
native | whether to use the native scrollbar style | boolean | false |
wrap-style | style of wrap container | string / object | — |
wrap-class | class of wrap container | string | — |
view-style | style of view | string / object | — |
view-class | class of view | string | — |
noresize | do not respond to container size changes, if the container size does not change, it is better to set it to optimize performance | boolean | false |
tag | element tag of the view | string | div |
always | always show scrollbar | boolean | false |
min-size | minimum size of scrollbar | number | 20 |
id 2.4.0 | id of view | string | — |
role 2.4.0 a11y | role of view | string | — |
aria-label 2.4.0 a11y | aria-label of view | string | — |
aria-orientation 2.4.0 a11y | aria-orientation of view | enum | — |
Events
Name | Description | Type |
---|---|---|
scroll | triggers when scrolling, return distance of scrolling | Function |
Slots
Name | Description |
---|---|
default | customize default content |
Exposes
Name | Description | Type |
---|---|---|
handleScroll | handle scroll event | Function |
scrollTo | scrolls to a particular set of coordinates | Function |
setScrollTop | Set distance to scroll top | Function |
setScrollLeft | Set distance to scroll left | Function |
update | update scrollbar state manually | Function |
wrapRef | scrollbar wrap ref | object |