getPrefixedEventHandlers
Commons
stable
Filters event-handler attrs by a trailing suffix, strips the suffix, and wraps each handler so it receives an extra getData argument. Used internally to forward scoped event listeners through component boundaries.
API
Signature
Signature TypeScript complète, extraite du fichier util.
API
Paramètres
Paramètres d'entrée acceptés par cet util.
- attrsrequisRecord<string, any>
- The raw attrs object from $attrs / useAttrs(). Only keys that pass isOn() and end with the given suffix are selected.
- suffixrequisT
- A colon-prefixed suffix string (e.g. ":input"). Event handler keys ending with this suffix are matched and stripped.
- getDatarequisTEventHandler
- A function called with each event to produce the extra data argument forwarded to the original handler.
API
Valeur de retour
La valeur retournée par cet util.
- An object keyed by the stripped event handler names, each wrapping the original handler with the extra getData call.
Usage
Exemples
Extraits de code prêts à coller.
Forward scoped event handlers