isOn
Commons
stable
Returns true when a prop key is a Vue event listener name — i.e. starts with "on" followed by an uppercase letter. Used to separate event handlers from regular props when forwarding attrs.
API
Signature
Full TypeScript signature sourced from the util file.
API
Parameters
Input parameters accepted by this util.
- keyrequiredstring
- The prop key string to test against the Vue event handler pattern (e.g. "onClick", "onUpdate:modelValue").
API
Return value
The value returned by this util.
- true when the key matches the /^on[^a-z]/ pattern (Vue event listener convention); false otherwise.
Usage
Examples
Ready-to-paste usage snippets.
Filtering event handlers from other attrs