What do you think about new emits property? It allows you to type hint emits when using with TS. For example:
exportdefaultdefineComponent({emits:{'foo':(arg:string)=>{// some validation logic for runtime },},mounted(){tis.$emit('foo',1)// type error, you can emit only strings for 'foo' event},})
Hey! Thanks for the article, nice solution.
What do you think about new
emits
property? It allows you to type hint emits when using with TS. For example:Further reading:
v3.vuejs.org/api/options-data.html...
github.com/vuejs/rfcs/blob/master/...