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
I have a fairly complicated component where I need to have emits defined dynamically. I define the name of event using the actions property. In Vue 2 (Options API) I had no problem with it, while in Vue 3 (Composition API) I got the following error:
Type '(deletedRow: RowItem) => void' is not assignable to type 'FillingEventArg<(({ "change-sorting": (column: string) => void; } & { [x: string]: (item: { [key: string]: any; }) => void; })[Uncapitalize<Capitalize<string>>] extends null ? (...args: any[]) => any : (...args: ({ ...; } & { ...; })[Uncapitalize<Capitalize<string>>] extends (...args: infer P) => any ? P : never) =>...'.ts(2322)
__VLS_types.ts(108, 56): The expected type comes from property 'delete-row' which is declared here on type 'EventObject<{ $: ComponentInternalInstance; $data: {}; $props: Partial<{ filters: { [key: string]: string[]; }; actions: { icon: string; emit: string; }[]; editable: boolean; }> & Omit<...>; ... 10 more ...; $watch(source: string | Function, cb: Function, options?: WatchOptions<...> | undefined): WatchStopHandle; } ...'
I found this 2020 thread (vuejs/rfcs#204) that would solve my problem, but as far as I can see, they haven't implemented it yet. I have used this workaround temporarily.
I have a fairly complicated component where I need to have emits defined dynamically. I define the name of event using the
actions
property. In Vue 2 (Options API) I had no problem with it, while in Vue 3 (Composition API) I got the following error:Emits type:
Actions rendering:
Are you able to fix it somehow?
The text was updated successfully, but these errors were encountered: