eventName

Commons
stable

Converts a Vue prop name in the "onXxx" format to the corresponding event name "xxx". Used internally to derive emit names from prop names.

API

Signature

Full TypeScript signature sourced from the util file.

typescript

API

Parameters

Input parameters accepted by this util.

propName
required
string
A Vue prop name starting with "on" followed by a capitalised event name, e.g. "onClick", "onUpdate:modelValue".

API

Return value

The value returned by this util.

The corresponding event name with the "on" prefix removed and the first letter lowercased, e.g. "click" or "update:modelValue".

Usage

Examples

Ready-to-paste usage snippets.

Derive event name from prop

typescript