'What are the naming conventions for custom Vue events?
When using a named v-model like this:
<my-component v-model:visible="visibleBoolean" />
We use a special emit on the child component that looks like this:
<button v-if="visible" @click="$emit('update:visible', false)">
But that got me thinking about how I name my other events not tied to a v-model.
Should they also have a keyword like update: or something similar preceeding them?
I know it's not required for it to work, but I'm trying to understand defacto naming conventions.
For example, should emit('my-custom-event') have any preceeding keyword in the name?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
