I am encountering an issue while using typescript 2.8.3, ts-loader 3.5.0 (as I'm using webpack 2), and vue 2.5.16. The problem arises when attempting to define components in a Single File Component (SFC) like the code snippet below:
<script lang="ts">
import Vue from 'vue'
export default Vue.extend({
name: 'TestComponent',
props: {
options: {
type: Array,
default: () => [],
}
},
computed: {
getOptions() {
return this.options
},
}
})
</script>
The error message received is:
TS2339: Property 'options' does not exist on type 'ComponentOptions, DefaultMethods, DefaultComputed,PropsDefinition'
Below is the content of tsconfig.json:
{
"compilerOptions": {
"target": "es5",
"module": "esnext",
"strict": true,
"jsx": "preserve",
"moduleResolution": "node",
"allowSyntheticDefaultImports": true,
"sourceMap": true,
"noImplicitAny": false,
"baseUrl": ".",
"allowJs": true,
"paths": {
"test/*": ["test/*"]
},
"lib": ["dom", "es2016"],
"types": ["node", "jest"]
},
"include": ["resources/assets/js/**/*.ts", "resources/assets/js/**/*.vue"],
"exclude": ["node_modules"]
}
Seeking suggestions or solutions to resolve this issue. It seems to work fine if setting "noImplicityThis" to false, however, the autocomplete feature in VSCode does not function correctly in this case.