Closed
Description
Version
2.6.10
Reproduction link
https://github.com/Patcher56/ts3.4.x-vuejs-issue
Steps to reproduce
- create a new vue typescript project (without class syntax)
vue create test-ts
- open
src/components/HelloWorld.vue
- add a data variable and try to access it in a computed property
What is expected?
No errors (as the data is defined)
What is actually happening?
Typescript error 2339 telling me
Property 'test' does not exist on type 'CombinedVueInstance<Vue, {}, {}, {}, Readonly<{ msg: string; }>>'.
I think this has something to do with the changed type inference in Typescript 3.4.x.
Important: Change vetur settings to use workspace dependencies to show errors directly in vscode, else you will only get the error when using yarn serve
.