On most components, when using this inside for example a method on my vue object, it gets type CombinedVueInstance, which is how it should be. But sometimes, it gets types like Vue when accessing this in a method and Accessors<DefaultComputed> when accessing this in a computed method, even though nothing seems to be different. This is what the code looks like:
import Vue, { PropType } from 'vue'
export default Vue.extend({
props: {
field: Object as PropType<FieldType>,
row: Boolean as PropType<boolean>,
events: Object,
},
data() {
return {
value: undefined,
}
},
computed: {
required() {
return this.field.required && !this.value
},
invalid() {
return this.field.isValid && !this.field.isValid(this.value)
}
},
Why does this sometimes not get type CombinedVueInstance when used inside the Vue component object?