We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
3.0.11
https://github.com/danielvy/vue-emits.git
run npm run build
npm run build
See App.vue
Typescript project should compile.
Typescript reports an error:
TS2684: The 'this' context of type 'ComponentPublicInstance<{}, {}, {}, {}, { test(): void; }, "test"[], {}, {}, false, ComponentOptionsBase<{}, {}, void, {}, { test(): void; }, ComponentOptionsMixin, ComponentOptionsMixin, "test"[], string, {}>>' is not assignable to method's 'this' of type 'void | ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>>'. Type 'ComponentPublicInstance<{}, {}, {}, {}, { test(): void; }, "test"[], {}, {}, false, ComponentOptionsBase<{}, {}, void, {}, { test(): void; }, ComponentOptionsMixin, ComponentOptionsMixin, "test"[], string, {}>>' is not assignable to type 'ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>>'. Type 'ComponentPublicInstance<{}, {}, {}, {}, { test(): void; }, "test"[], {}, {}, false, ComponentOptionsBase<{}, {}, void, {}, { test(): void; }, ComponentOptionsMixin, ComponentOptionsMixin, "test"[], string, {}>>' is not assignable to type '{ $: ComponentInternalInstance; $data: {}; $props: {}; $attrs: Record<string, unknown>; $refs: Record<string, unknown>; $slots: Readonly<InternalSlots>; ... 7 more ...; $watch(source: string | Function, cb: Function, options?: WatchOptions<...> | undefined): WatchStopHandle; }'. Types of property '$emit' are incompatible. Type '(event: "test", ...args: any[]) => void' is not assignable to type '(event: string, ...args: any[]) => void'. Types of parameters 'event' and 'event' are incompatible. Type 'string' is not assignable to type '"test"'. 17 | 18 | mounted() { > 19 | this.$nextTick(() => { | ^^^^ 20 | 21 | }); 22 | },
The text was updated successfully, but these errors were encountered:
this
nextTick
Any update on when this will be merged?
Sorry, something went wrong.
fix(type): infer parent as this on nextTick function (#3608)
18911ab
fix #3599
Successfully merging a pull request may close this issue.
Version
3.0.11
Reproduction link
https://github.com/danielvy/vue-emits.git
Steps to reproduce
run
npm run build
See App.vue
What is expected?
Typescript project should compile.
What is actually happening?
Typescript reports an error:
The text was updated successfully, but these errors were encountered: