ViewportScroller
Defines a scroll position manager. Implemented by BrowserViewportScroller
.
abstract class ViewportScroller {
abstract setOffset(offset: [number, number] | (() => [number, number])): void
abstract getScrollPosition(): [number, number]
abstract scrollToPosition(position: [number, number]): void
abstract scrollToAnchor(anchor: string): void
abstract setHistoryScrollRestoration(scrollRestoration: "auto" | "manual"): void
}
方法
Configures the top offset used when scrolling to an anchor. |
Retrieves the current scroll position. |
参数没有参数。 返回值
|
Scrolls to a specified position. |
Scrolls to an anchor element. |
Disables automatic scroll restoration provided by the browser. See also window.history.scrollRestoration info. |