Closed
Description
Version
2.5.13
Steps to reproduce
Create a simple component using Typescript:
import Vue from "vue"
Vue.extend({
props: {
myProp: {
type: Array,
},
},
computed: {
myComputed(): string {
return "hello"
},
otherComputed(): string {
return this.myComputed
},
},
})
We have the following error:
TS2322: Type '(() => any) | ComputedOptions<any>' is not assignable to type 'string'.
Type '() => any' is not assignable to type 'string'.
If we change the type of the prop to String
, Number
or smtg else we don't have this problem anymore
What is expected?
No error
What is actually happening?
Errors
This problem was not happening with the previous Typescript versions (at least 2.5.2)