Subscribe on changes!

Autocomplete the child components' event

avatar
Dec 18th 2020

What problem does this feature solve?

register the emits option in child component, when using this component , after we input '@ ' , it should autocomplete

What does the proposed API look like?

type infer and autocomplement You can test here

// child

defineComponent({
   emits:['welcome','hello']
})

// App.vue

<Child  @=" " />

it should pull a list including 'welcome' and 'hello' and no need make declaration in props if use JSX/TSX Whether using JSX or Vue, both of them have props infer, especially in JSX, we need to register the event in 'props' by hand , it's better if we can infer events from emits option

avatar
Dec 18th 2020

This should be oppened (or searched for in existing issues) in Vetur, or vue dx repositories (VSCode plugins)