docs icon indicating copy to clipboard operation
docs copied to clipboard

v-on event listener name mangling nuance

Open noellelevydialpad opened this issue 1 year ago • 1 comments

https://github.com/vuejs/docs/blob/fe96839c9fe1ce82150e5a4396235cb3d1fb76e2/src/guide/components/attrs.md?plain=1#L109

This does not make it entirely clear that the conventional kebab casing of event names would be camel cased i.e. @my-event would result in an attr named onMyEvent. And it also does not document how any uppercase letter makes it simply prefix on: to the name with no transform, like @My-event yields on:My-event

noellelevydialpad avatar Dec 11 '24 01:12 noellelevydialpad

Upon further investigation it only generates the on:My-event type for elements which are not components and it is harder to get your hands on those event handlers. The full camel case transformation should probably be more clearly documented though.

noellelevydialpad avatar Dec 11 '24 04:12 noellelevydialpad