Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upfeat: custom-event-name-casing custom casing #1260
Comments
Thank you for your proposal. However, it seems to me that the options you have proposed are a bit limited. The following is my idea. Add the e.g. What do you think? Does the |
Yeah that works! Thank you @ota-meshi |
Vuetify also uses |
|
@bitencode |
My apologies @ota-meshi, it does ignore that specific use case. When I upgraded to the new version of this plugin we had hundreds of errors about "must be kebab-case" that I missed the fact that using |
Extension of this bug report: #1250
Request
For the ability to customize what kind of casing should be enforced on event names.
Use case
Name spacing
In my codebase we namespace events using
:
with the component name for frictionless composability. That way, when composing components, there would be no collision in emitted events. (eg.input:update
)For example, a custom Input component would emit
input:update
, which triggers the new v-model value (not to takeover native event names with different values). There could be another component, for example Search, that uses this Input component and emit another "update" event with more data viasearch:update
.camelCase in Vue 3 docs
With Vue v3,
v-model
replaces.sync
and their docs seem to contain a lot of examples using camelCase in event names.(This is pretty confusing considering they still recommend event names be case insensitive (lower case) at the top.)
If this isn't a mistake, then surely, some people would want to use camelCase in their event names. (vuejs/docs-next#308)
Edit:
Changing to
v-model.prop-name
seems to be necessary in a non-compiled environment (haven't tested in a compiled one). Bothupdate:propName
andupdate:prop-name
seem to work. CodepenProposed API
Just some ideas I had:
ignoreCharacters: [':']
allowCharacters: [':']
allowNamespace: true
allowDelimiters: ':'