samo
Default emit definition
Hey I'm new to the vue/nuxt ecosystem. One thing I'm confused about is how to properly define a default emit. For example:
Now this works and is typed correctly, however if I try to do something akin to
withDefaults
on props i.e.
I've scoured all the vue/nuxt docs and stackoverflow and I was unable to find any reference to this. Is there truly no way to have a default emit handler? If not, what is the best way to do this?
I could technically just pass the function in defineProps
with a function - issue with this is, I get a hydration warning about mismatch - presumably because of the useNuxtApp
composable or props passing / initialization.
Thanks in advance5 replies