Is it @update:model-value
or @update:modelValue
#9785
Unanswered
frederikheld
asked this question in
Help/Questions
Replies: 2 comments 4 replies
-
|
Beta Was this translation helpful? Give feedback.
1 reply
-
I'm upvoting this as I'm just in a dependency update and received this eslint error: So I've fixed the issue in the code and see right below <ComponentA v-model:show-form="modalActive" @toggle-modal="toggleModal" />
<ComponentB v-model="criteria.value" @update:modelValue="onCriteriaUpdate" /> |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Ever since Vue3 changed the way the v-model is being passed, I'm in constant confusion about whether it is correct to write
@update:model-value
or@update:modelValue
because the official docs tell me different things:@update:modelValue
: https://v3-migration.vuejs.org/breaking-changes/v-model.html@update:model-value
on the component butupdate:modelValue
in thedefineEmits
: https://vuejs.org/guide/components/v-model.htmlupdate:modelValue
: https://vuetifyjs.com/en/api/v-dialog/#events (and I expect a component library to call it like you would use it on the component tag but idk)I know that in JS we use the camel case
modelValue
. But what should I use on the component tag? And how should I call it in thedefineEmits
andemit
functions? Like I use it on the component tag (kebab-case) or like I use it in the code (camelCase)?This is super confusing and not very clear.
This is my closest guess:
Component "MyThingy.vue":
Parent component:
Is this correct?
Beta Was this translation helpful? Give feedback.
All reactions