repositionScrollStrategy

Commons
stable

Scroll strategy that repositions a floating overlay (menu, tooltip, popover) to track its anchor when the page scrolls. Automatically throttles updates via requestIdleCallback when repositioning is slow.

API

Signature

Signature TypeScript complète, extraite du fichier util.

typescript

API

Paramètres

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

data
requis
IScrollStrategyData
Runtime context for the scroll strategy: references to the target element, content element, and the updateLocation callback used to reposition the overlay.
_props
requis
IScrollStrategyProps
Component props for the scroll strategy. Not used directly by reposition but required by the shared scroll-strategy interface.
scope
requis
EffectScope
Vue EffectScope in which the scroll listener and animation-frame cleanup are registered. The strategy is automatically torn down when the scope stops.

API

Valeur de retour

La valeur retournée par cet util.

No return value. The strategy wires up and tears down scroll listeners reactively within the provided EffectScope.

Usage

Exemples

Extraits de code prêts à coller.

Attach to an overlay via the scrollStrategy prop

html