-
-
Notifications
You must be signed in to change notification settings - Fork 506
Closed
Labels
questionFurther information is requestedFurther information is requested
Description
Context
I am developing a project using Vue 2.6.14 version.
That being said, I have configured tsconfig's vueCompilerOptions.target to "2".
Lets say I create the following component:
<script>
export default {
data() {
return {
name: "Alfa"
}
}
}
</script>Now, lets also suppose I add the "created" hook:
<script>
export default {
...
created() {
this.name = "Beta";
}
}
</script>Problem
The issue arises when I type "this." in the created() hook - or any other method or computed function, for that matter - the "this" keyword is set to type "any", as opposed to the correct type which should be an extension of Vue with a string property "name".
So, type inferring is completely off. Now, I have no idea wether this is a general bug of the extension, or it is simply related to the use of the "export default" syntax, using Vue 2 syntax.
Environment
- Volar: 0.40.13
- Vue: 2.6.14
- VSCode: 1.71.0
- Typescript: 4.8.3 (in takeover mode)
Metadata
Metadata
Assignees
Labels
questionFurther information is requestedFurther information is requested