There are many examples/solutions to this particular error, but in my case I think it must have a different, underlying cause. Possibly configuration related.
The code is
export default {
data() {
return {
asyncDataStatus_ready: false,
};
},
methods: {
asyncDataStatus_fetched():any {
this.asyncDataStatus_ready = true;
this.$emit('ready');
},
},
};
The errors are
Property 'asyncDataStatus_ready' does not exist on type '{ asyncDataStatus_fetched(): any; }'. Did you mean 'asyncDataStatus_fetched'?ts(2551)
and
Property '$emit' does not exist on type '{ asyncDataStatus_fetched(): any; }'.ts(2339)
So it seems to me as if Typescript thinks these are properties of asyncDataStatus_fetched, which they are not. Wondering if it has to do with 'this', but not sure what else to try. Thinking there must be another way for methods to access data in a .ts. file vs a .vue file.