Scrollbar
Used to replace the browser's native scrollbar.
Basic usage
Horizontal scroll
Max height
Manual scroll
Scrollbar Attributes
Attribute | Description | Type | Accepted Values | 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 warp container | string | — | — |
wrap-class | class of warp container | string | — | — |
view-style | style of view | string | — | — |
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 |
Scrollbar Events
Event Name | Description | Parameters |
---|---|---|
scroll | triggers when scrolling | distance of scrolling { scrollLeft, scrollTop } |
Scrollbar Methods
Method | Description | Parameters |
---|---|---|
setScrollTop | Set distance to scroll top | (scrollTop: number) |
setScrollLeft | Set distance to scroll left | (scrollLeft: number) |
update | update scrollbar state manually | — |
Scrollbar Slots
Name | Description |
---|---|
— | customize default content |