getContainer

Commons
stable

Resolves the scroll container element from a CSS selector string, a Vue component instance, or an HTMLElement. Falls back to document.scrollingElement or document.body when the argument is omitted or resolves to null.

API

Signature

Signature TypeScript complète, extraite du fichier util.

typescript

API

Paramètres

Paramètres d'entrée acceptés par cet util.

el
ComponentPublicInstance | HTMLElement | string
Target descriptor. A string is used as a CSS query selector; a Vue instance unwraps to its root element; an HTMLElement is used directly. Omit to get the document scroll root.

API

Valeur de retour

La valeur retournée par cet util.

The resolved HTMLElement to use as a scroll container. Never null — falls back to document.scrollingElement or document.body.

Usage

Exemples

Extraits de code prêts à coller.

Resolve a container from different input types

typescript