-
-
Notifications
You must be signed in to change notification settings - Fork 33.8k
Closed
Description
Version
2.7.14
Reproduction link
Or create this file in minimal vue-ts (v2) project
import {defineComponent} from "vue";
import App from "./App.vue";
export default defineComponent({
// comment next line, and it works fine.
components: {App},
// or uncomment next line, and it works fine
//props: {},
data() {
return {};
},
provide(): any {
return {
fetchData: this.fetchData,
};
},
created() {
this.fetchData();
},
methods: {
fetchData() {
throw new Error("Not implemented.");
},
},
});Steps to reproduce
Clone example repo, run pnpm install, run pnpm vue-tsc
What is expected?
No errors.
What is actually happening?
src/broken-method-type.ts:15:23 - error TS2339: Property 'fetchData' does not exist on type 'CreateComponentPublicInstance ...
It works if you remove components: ... line, or add empty props: {}.
(This is continuation of #12628 which is not fixed completely, or happened again, in my project it was working with vue-tsc<1.0, but happened again after update)
andypattenden, sceee, devinant, ludwig801, joaopedrodcf and 1 more
Metadata
Metadata
Assignees
Labels
No labels