Function: getCamelAndMaybeKebabPropKeysFor()
ts
function getCamelAndMaybeKebabPropKeysFor(key: string): {
camel: string;
kebab: string;
};Converts an event name to both camelCase and kebab-case handler prop names. Handles events with colons by treating the first part specially (prepending 'on').
Parameters
| Parameter | Type | Description |
|---|---|---|
key | string | The event name (e.g., 'update:modelValue') |
Returns
ts
{
camel: string;
kebab: string;
}Object with both camelCase and kebab-case versions of the handler prop
| Name | Type |
|---|---|
camel | string |
kebab | string |
Example
typescript
getCamelAndMaybeKebabPropKeysFor("update:modelValue");
// Returns: { camel: 'onUpdateModelValue', kebab: 'onUpdate:modelValue' }