You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As mentioned in #1061 (comment) it seems it is currently not possible to type $emit using the method suggested in #750 (comment). The base interface uses a this return type and assigning void gives a TypeScript error that an arbitrary type can be passed.
Is there updated methodology for this? Or is this something that has fallen out of favor?
The text was updated successfully, but these errors were encountered:
Hi @barfurth, I'm not really understand the problem, could you provide a complete code sample?
Just in case, make sure you have at least define a empty object type for $props to make to component is a valid JSX element. So it will not show red color in other components.
The auto-completion works with this, but it does not compile. When you open the component the $emit part is marked as an error.
Property '$emit' in type 'HelloWorld' is not assignable to the same property in base type 'object & Record<never, any> & Vue'.
Type '{ (e: "my-event-1"): void; (e: "my-event-2", arg1: string, arg2: number): void; }' is not assignable to type '(event: string, ...args: any[]) => this'.ts(2416)
There seems to be some problem with this assignment. The $props and the $scopedSlots work perfectly. This is related to the Vue interface definition of $emit I believe.
As mentioned in #1061 (comment) it seems it is currently not possible to type
$emit
using the method suggested in #750 (comment). The base interface uses athis
return type and assigningvoid
gives a TypeScript error that an arbitrary type can be passed.Is there updated methodology for this? Or is this something that has fallen out of favor?
The text was updated successfully, but these errors were encountered: