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.
API
Parameters
Input parameters accepted by this util.
- elrequiredIHoverHtmlElement
- The DOM element that carries the _hover internal state bag.
- bindingrequiredIHoverDirectiveBinding
- Vue directive binding; its value determines enabled state and optional callbacks; modifiers.stop enables ripple-stop mode.
- wasEnabledrequiredboolean
- Whether the directive was enabled before this update. Used to avoid double-attaching listeners.
- namerequiredstring
- 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