updateHover

Commons
stable

Sync the v-hover directive's internal state on an element when its binding value or modifiers change. Adds or removes the hover class and mouse/touch listeners accordingly.

API

Signature

Full TypeScript signature sourced from the util file.

typescript

API

Parameters

Input parameters accepted by this util.

el
required
IHoverHtmlElement
The DOM element that carries the _hover internal state bag.
binding
required
IHoverDirectiveBinding
Vue directive binding; its value determines enabled state and optional callbacks; modifiers.stop enables ripple-stop mode.
wasEnabled
required
boolean
Whether the directive was enabled before this update. Used to avoid double-attaching listeners.
name
required
string
The component block name used to build the hover class, e.g. "origam-btn" produces class "origam-btn--hover".

API

Return value

The value returned by this util.

No return value. Mutates the element's event listeners and _hover state in place.

Usage

Examples

Ready-to-paste usage snippets.

Directive updated hook

typescript