Skip to content

CodeLayoutScrollbar

CodeLayoutScrollbarDemo

CodeLayoutScrollbar is a Vue scrollbar component. If you feel that the browser scrollbar does not match CodeLayout, you can try using CodeLayoutScrollbar, which has a unified style built-in.

Props

PropertyDescriptionTypeDefault
scrollSpecify which directions can be scrolled'both'│'none'│'vertical'│'horizontal''both'
scrollBarSizeSet the size of the scroll bar in pixelsnumber8
containerClassCSS class of inner containerstring''

Slots

Slot nameDescriptionParam
defaultContent rendering slot-

Instance

refreshScrollState(): void

Description:

Force refresh of scrollbar state.

getScrollContainer(): HTMLElement | undefined

Description:

Get the element instance of the internal scrolling container.

Returns:

TypeDescription
HTMLElementIf returned undefined, it may be the component has not been initialized yet

scrollTo(x: number, y: number): void

Description:

Set scroll position.

Param:

NameTypeDescription
xnumberx pos (pixel)
ynumbery pos (pixel)

scrollToTop(): void

Description:

Scroll to bottom/right.

scrollToBottom(): void

Description:

Scroll to bottom/right.

Released under the MIT License.