I am encountering an error in my Vue component with Typescript, even though I have correctly declared types. The error pertains to the line mentioned in the title of this issue and below is a simplified version of the component causing the problem:
import Vue from 'vue';
const Component = Vue.extend({
props: {
value: {
type: Number,
default: null
},
index: {
type: Number,
required: true
}
},
computed: {
stepNumber(): number {
return this.index + 1;
}
}
})
export default Component;
The specific issue arises with "this.index+1". Even though I specified the type as 'number' for the prop 'index', the error persists. Any insights on why this might be happening?