I created a vue component with TypeScript, and I\'m getting this error in data()
and in methods()
:
Property \'xxx\' does not exist
As mentioned in the Typescript Support section of the Vue documentation:
Because of the circular nature of Vue’s declaration files, TypeScript may have difficulties inferring the types of certain methods. For this reason, you may need to annotate the return type on methods like render and those in computed.
In your case, you should change profilePath: function () {
to profilePath: function (): string {
You might come across the same error if you have a render() method that returns a value, without a : VNode
annotation.