Essentially i have the same question as this and this issue on Github, which unfortunately were both closed before being answered :/
I am using Vue with Typscript and the Vue Class Components.
What i need to do is to access a method of my (Vue-) Class from inside a watcher inside the @Component decorator.
I know that it's possible to access the data of a component with this.$data, but what about methods.
My code works on runtime but produces compiletime-errors and errors in vscode ("Property 'clearInfo' does not exist on type 'Vue'.");
@Component({
watch: {
firstMesh(newMesh) {
if (newMesh === undefined) this.clearInfo(1); // this produces the errors
else this.showMeshInfo(newMesh, 1);
},
secondMesh(newMesh) {
if (newMesh === undefined) this.clearInfo(2);
else this.showMeshInfo(newMesh, 2);
},
},
})
export default class Info extends Vue {
clearInfo(whichMesh : number) {
...
}
showMeshInfo(mesh : any, index : number) {
....
}
}