defineModel behaviour is not the same as prop + event syntaxe anymore #12763
ChamNouki
started this conversation in
General Discussions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello dear fellows 👋
I'm confronted to an inconsistent behaviour between defineModel and it's older and fully qualified syntaxe using a prop and an event.
Using defineModel
When I assign the same value to the model as the model actual value, this doesn't emit event to the parent component. This behaviour comes from defineModel is triggering update event, even if its value didn't actually change #11125 and associated merged PR.
defineModel use case
Using prop and event
On the contrary, emitting an event with the same value as the previous emitted event trigger the update on the parent component.
prop+event use case
This behavioral difference is quite annoying in my opinion : the library should not take the responsability of choosing when to emit or not the event when assigning a value to the model through defineModel. Especially when the documentation says that defineModel is only syntax suggar for the prop+event syntaxe to be able to use v-model.
Beta Was this translation helpful? Give feedback.
All reactions