Open
Description
Version
2.7.14
Reproduction link
Steps to reproduce
- run
pnpm install
(or use npm, yarn) - run
pnpm type-check
(actual command isvue-tsc --noEmit
)
What is expected?
no error
What is actually happening?
An error was reported: The method in option methods
could not be found in the option data
src/main.ts:6:19 - error TS2339: Property 'method1' does not exist on type 'CreateComponentPublicInstance<{}, {}, {}, {}, {}, ComponentOptionsMixin,
ComponentOptionsMixin, {}, {}, {}, false, OptionTypesType<{}, {}, {}, {}, {}, {}>, {}, {}, {}, {}, {}, {}>'.
6 data1: this.method1(),
~~~~~~~
The main code in the repository is:
defineComponent({
data() {
return {
data1: this.method1(),
}
},
methods: {
method1(): number {
return 1
}
}
})
Metadata
Metadata
Assignees
Labels
No labels