Actually I am a little bit ashamed to learn all of that just now. I never went so deeply in the logic behind and am really happy to understand what's underneath. Maybe one of the best explanation I have seen on that. Thanks Luke!
Super cool Luke and timely starting forms/dialogs today. Thanks I have a lot to do. Need to experiment a little to take this one more level and decouple the form from the dialog. I like having my forms a little more flexible so I can use them when needed in a page/card, a dialog and/or a slide-in. Nonetheless you finally gave me clarity on props/emits and defineModel!
Oh absolutely! I hope it was clear I'd almost never put a form directly in a dialog, and it would be in its own component. Probably shouldn't have been lazy and shown that!
22:25 useVModel does not define the emits. Defining emits is entirely optional. You can call emit with any event name and payloads you want at any time. All defineEmits does is document which events there are so you can get type checking and intellisense when using emit or attaching event listeners.
Looked through the source code for useVModel and can see that you're right! I assumed it did, because usually Vue throws a warning when trying to emit an event that doesn't exist, yet it seems that's only the case when going through defineEmits. That makes sense, because if we didn't have a way to do dynamic emits... that would suck! Thanks for the correction :)