vuejs / core

🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
https://vuejs.org/
MIT License
47.36k stars 8.28k forks source link

Autocomplete the child components' event #2845

Closed HomyeeKing closed 3 years ago

HomyeeKing commented 3 years ago

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

posva commented 3 years ago

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