[FR] Function style declaration of `defineEmits`
What problem does this feature solve?
Now that tuple style declaration is supported, can we also add function style declaration? It's closer to how we write defineProps<T>()
, and unlike tuple labels, the arguments have to be named, therefore more constraints.
What does the proposed API look like?
const emit = defineEmits<{
update(val: string): void
}>()
This has been discussed in the RFC repo: https://github.com/vuejs/rfcs/discussions/500